Dear, I have a .txt file with three columns: longitude, latitude and another variable (i.e. altitude, temperature, precipitation), the data are from weather stations, I have a value per station. As the seasons are sparse I used the griddata function to interpolate the values and then plotted a shaperfile over the image. The generated figure is as follows:: And the script I used is as follows: clear all close all load dados_dd.txt d = (dados_dd); lat = 0 - d(:,2); %negative because I am in the southern hemisphere lon = 0 - d(:,1); cota = d(:,3); N = 1000; [Xi, Yi] = meshgrid(linspace(-49,-44,N),linspace(-24,-20,N)); Ci = griddata(lon, lat, cota, Xi, Yi); imagesc(linspace(-49,-44,N),linspace(-24,-20,N),Ci); xlabel('Longitude'); ylabel('Latitude'); colorbar S = shaperead('shaperfile.shp') geoshow(S) I would like to know if there is a way to remove the parts that are outside the shaperfile I do not understand much of interpolation, is it possible to interpolate the data so that they fill the entire Shaperfile? Sorry for the inconvenience, but I really need help.
Kshitij Singh answered .
2025-11-20