Contour plot with polar stereoghapic projection in north hemispehere above 60 degree latitude
14 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Hi,
I have ut(24), lat(24) and z (24x24); data attached as .mat. I want to plot a contour plot in polar stereographic projection for northern hemisphere above 60 degree latitude (something like attached ). I tried with m_map polar sterographic projection.
m_proj('stereographic','lat',90,'long',30,'radius',60);
m_elev('contour',[0:0.00009:1],'edgecolor','b');
m_grid('xtick',12,'tickdir','in','ytick',[60:10:90],'linest','-');
m_coast('linewidth',1,'linestyle','-','color','k');
I got the image as completely different.
I also tried using like https://jp.mathworks.com/matlabcentral/answers/170145-how-to-plot-contourf-data-on-m-map-polar-stereographic-projection, the plot it is not in sterographic projection. Can anyone help.
0 commentaires
Réponses (1)
Milan Bansal
le 11 Sep 2024
Hi Madan Kumar
It looks like you're on the right track with using the m_map toolbox for polar stereographic projection. However, the code you provided seems to use m_elev and m_coast, which are for elevation data and coastline plotting, respectively, and may not apply directly to your data.
To contour plot your ut, lat, and z data correctly in a polar stereographic projection, try modifying your approach as shown in the sample code snippet below:
load('poldata.mat')
% Polar stereographic projection using m_map
m_proj('stereographic', 'lat', 90, 'long', 0, 'radius', 30); % Stereographic projection, centered at north pole
% Convert latitudes and UT into a meshgrid
[Lat, UT] = meshgrid(lat, ut);
% Plot the contour using m_contourf for filled contours
m_contourf(UT, Lat, z, 'LineStyle', 'none');
% Optional: Add a coastline (this might not be needed for your plot)
m_coast('line', 'color', 'k');
% Add grid lines and labels
m_grid('xtick', 12, 'tickdir', 'in', 'ytick', [60:10:90], 'linestyle', '-');
% Add colorbar for reference
colorbar;
Hope this helps!
0 commentaires
Voir également
Catégories
En savoir plus sur Contour Plots dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!