Contour plot with polar stereoghapic projection in north hemispehere above 60 degree latitude

14 次查看(过去 30 天)
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.

回答(1 个)

Milan Bansal
Milan Bansal 2024-9-11,9:05
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;
Please refer to the following link for more information : https://www.eoas.ubc.ca/~rich/mapug.html
Hope this helps!

类别

Help CenterFile Exchange 中查找有关 Contour Plots 的更多信息

产品


版本

R2023a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by