How can I remove all points outside a polygon in Post or Base map in Surfer?

While there is not an automatic option to remove points in a post or base map outside a polygon boundary in Surfer, there are a couple of options to accomplish this:

Method 1: Manually remove the points from the data file

This method is good if there are just a few points outside the boundary (less than 50) and involves the use of the Track Cursor command. You would use Track Cursor and click on points in a post map, and those points are highlighted in the worksheet. You can then delete the points in the worksheet, save the file, and reload the data. Those points will then be removed from the post map. If you have the plot and worksheet windows in a tiled view, then it makes editing of extraneous or other specific data points very easy.

Click in the plot window near one of the points outside the boundary, and that point is highlighted in the worksheet window.

Click in the worksheet window and edit or delete the point from the worksheet.

Then click back in the plot window near your next point and that point is highlighted in the worksheet window. Remove that point.

When you are done removing all the points from the worksheet, click File | Save As to save the changes to a new data file.

Select the Post layer in the Contents window and in the Properties window on the General page, click the Open File button, and load the new data file as the data file for the post map.

Method 2: Blank the grid outside the boundary, and identify the points that fall in the blanked areas with Grid Residuals

This method is good if there are a large number of data points outside the boundary, or if you are using Surfer 8 or previous. It involves using Residuals on a blanked grid to create a new data file. The data points that lie in the NoData (or blanked) regions (outside the polygon) are easy to identify in the new data file.

The steps are:

Click Home | Grid Data | Grid Data and grid the XYZ data from the points.

This opens a worksheet. Highlight all the data columns and click Data | Data | Sort.

Choose to sort by the Residuals column, in Ascending order, and click OK.

Now all the data points that are within the boundary are listed at the top of the worksheet with actual data in the Residuals column. Delete all the other data rows that do not have data in the Residuals column.

Click File | Save As and save this to a new data file. This new data file only has the data points within the boundary.