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 件のコメント
Susmit Subhransu Satpathy
2023 年 2 月 1 日
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 Center および File Exchange で PID Controller Tuning についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!