m_map and m_ll2xy problem

4 次查看(过去 30 天)
Hi all!
I'm trying to make some maps in matlab. I can create the map of the datas without problem but then I try to plot a mask with points that represent the statistical significance.
I use m_ll2xy to convert the coordenates but it just works for half of the matrix. I mean, I have a meshgrid witl lon and lat and the size 6x20 but when I use m_ll2xy it just convert the half and the other half I receive the same numbers than the first part, like a capicua. Also I attach the code that I use and a plot.
If you have any idea or don't understand what I mea, please, let me know.
Thank you and sorry for my english.
[long2,lat2]=meshgrid(longitude,latitude);
LatROI=[-63.2 -61.85];
LonROI=[-62.01 -57.01];
Fig=figure;
set(gcf, 'Color','white');
set(Fig, 'Position',[10, 10, 1200, 800]);
set(gcf,'Renderer','zbuffer')
m_proj('lambert','long',LonROI,'lat',LatROI);
m_contourf(longitude,latitude,primavera_trend','linecolor','none'),colorbar,caxis([-0.03 0.03]);
colormap(m_colmap('diverging',256));hcb=colorbar;title(hcb,'m/s')
hold on
[x,y]=m_ll2xy(long2,lat2);
stipple(x',y',mask2,'density',100,'markersize',7)
stipple(x',y',mask,'density',100,'markersize',20)
m_grid('box','fancy','tickdir','in');
title(['Spring trends 1988-2019'],'fontsize',14,'fontweight','bold','fontname','Arial')
  2 个评论
balaji SENAPATI
balaji SENAPATI 2021-5-15
Did you solve this issue?
Susmit Subhransu Satpathy
You can use m_plot to stipple your signifcant values. The notion is to use the loop in order to plot dots at grid points which have true value from your logical array.
In your case, you can use the following solution:
[long2,lat2]=meshgrid(longitude,latitude);
LatROI=[-63.2 -61.85];
LonROI=[-62.01 -57.01];
Fig=figure;
set(gcf, 'Color','white');
set(Fig, 'Position',[10, 10, 1200, 800]);
set(gcf,'Renderer','zbuffer')
m_proj('lambert','long',LonROI,'lat',LatROI);
m_contourf(longitude,latitude,primavera_trend','linecolor','none'),colorbar,caxis([-0.03 0.03]);
colormap(m_colmap('diverging',256));hcb=colorbar;title(hcb,'m/s')
hold on
for i = 1:size(mask2,1)
for j = 1:size(mask2,2)
if mask2(i,j)>0
m_plot(long2(j,i),lat2(j,i),'.','color','k','markersize',7);
end
end
end
for i = 1:size(mask,1)
for j = 1:size(mask,2)
if mask(i,j)>0
m_plot(long2(j,i),lat2(j,i),'.','color','k','markersize',20);
end
end
end
m_grid('box','fancy','tickdir','in');
title(['Spring trends 1988-2019'],'fontsize',14,'fontweight','bold','fontname','Arial')

请先登录,再进行评论。

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 PID Controller Tuning 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by