如何在 Matlab 中绘制给定纬度矢量 (Nx1)、经度矢量 (Mx1) 和数据点 (NxM) 的 mollweide 地图投影

How to plot, in Matlab, a mollweide map projection given a lat vector (Nx1), a longitude vector(Mx1), and data points (NxM)

我可以做一个简单的 pcolor 或 imagesc 图,其中

 dec=-90:1:90;
 ra=180:-1:-180;
 mydata=rand(181,361);
 imagesc(ra,dec,mydata)

如何使用 matlab 用 mollweide 投影绘制它?

我可以在 python 中很容易地完成,但是我不清楚 Matlab 中的映射函数我应该做什么。

我的真实数据不是随机的,但随机数据在这里最容易生成。

好的,感谢 shamalaia 将我指向 m_map,其中包含 m_pcolor.

 figure(1);clf(1);
 dec=-90:1:90;
 ra=180:-1:-180;
 mydata=rand(181,361);
 m_proj('mollweide','clongitude',0);
 obj=m_pcolor(ra,dec,mydata); 
 shading interp; 
 m_grid('xaxislocation','middle','xtick',8,'ytick',7,'fontsize',7,'color','white');

 mymap=colormap('jet');
 colormap(mymap);
 h=colorbar('h');
 caxis([0 1]);

使用 Matlab 的映射命令 - 这似乎不如 m_map 直观。

注意:要在上面的示例中使用此代码,请设置 moonalbrefvec(1)=1;

我不喜欢制作的标签,所以我自己制作了。

clear;
figure(2); clf(2);
load moonalb % a 540x1080 matrix of values is loaded along with moonalbrefvec=[3;90;0]
moonalbrefvec(1)=3; % this is the subdivisions per degree - thus 180*3=540 & 3*360=1080
moonalbrefvec(2)=90; % NW lat value
moonalbrefvec(3)=180; % NW long value
mymap=colormap('jet'); mymap(1,1:3)=1;colormap(mymap);
axesm('MapProjection','mollweid','MapLatLimit',[-90 90],'Gcolor','white','GLineWidth',2.0,'MLineLocation',[-135 -90 -45 0 45 90 135],'PLineLocation',30) ; 
axis off;caxis([0 500]); 
grid on;
plabel('LabelFormat','none');
mlabel('on');
parallel='equator';
mlabel(parallel);
mlabel('FontColor','white');
mlabel('off');
gridm('on');
geoshow(moonalb, moonalbrefvec, 'DisplayType', 'texturemap');
plabel('off')
c=colorbar('location','southoutside','box','on','color',[0 0 0]);
c.Label.String='T_{sky} (K)';
c.Limits=[0 500];
c.Ticks=0:50:500;
c.FontSize=12;
textm(-5,-135,'3 h','color','white','fontsize',25);
textm(-5,-90,'6 h','color','white','fontsize',25);
textm(-5,-45,'9 h','color','white','fontsize',25);
textm(-5,0,'12 h','color','white','fontsize',25);
textm(-5,45,'15 h','color','white','fontsize',25);
textm(-5,90,'18 h','color','white','fontsize',25);
textm(-5,90,'18 h','color','white','fontsize',25);
textm(-5,135,'21 h','color','white','fontsize',25);