Creating smooth surf plot from discrete values
Afficher commentaires plus anciens
Hi Guys,
I'm trying to create a surf plot by doing this:
%Change lat/lon to polar coords
[x1,y1] = projfwd(mstruct,place_lat,place_lon)
plot(x1,y1,'x'); %Plot the points on 2D plane
[x2 y2] = meshgrid(x1,y1);
surf(x2,y2,grid_array);
Where grid_array is an array of values for given x2 and y2. The plot itself is just flat planes with no curves or interpolation (may be using that word wrong).
Would anyone have any ideas on getting a smooth curve between each grid_array result for a given (x2,y2)?
Your help is very much appreciated.
2 commentaires
mizuki
le 20 Déc 2016
1. Check the sizze of the x2, y2, grid_array
2. Remove the EdgeColor
I could write smooth surface with the following code:
S = shaperead('usastatehi', 'UseGeoCoords', true, ...
'Selector',{@(name) strcmpi(name,'Massachusetts'), 'Name'});
proj = geotiffinfo('boston.tif');
lat = [S.Lat];
lon = [S.Lon];
grid_array = rand(length(lat), length(lon));
grid_array = sort(grid_array);
[x1, y1] = projfwd(proj, lat, lon);
plot(x1,y1,'x'); %Plot the points on 2D plane
[x2 y2] = meshgrid(x1,y1);
h = surf(x2,y2,grid_array);
h.EdgeColor = 'none'
Gregory jones
le 28 Déc 2016
Réponses (0)
Catégories
En savoir plus sur Surface and Mesh Plots dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!