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

15 Ansichten (letzte 30 Tage)
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.

Antworten (1)

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

Kategorien

Mehr zu Contour Plots finden Sie in Help Center und File Exchange

Produkte


Version

R2023a

Community Treasure Hunt

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

Start Hunting!

Translated by