フィルターのクリア

How to apply hatched region to a polar map

6 ビュー (過去 30 日間)
HA
HA 2019 年 1 月 23 日
回答済み: Chad Greene 2019 年 2 月 15 日
I have a polar contour map using the mapping toolbox (see code below) that I would like to add a hatched region to, in order to show significance.
load coastlines
axesm('stereo','Origin',[-90 0],'MapLatLimit',[-90 -30])
framem on;
gridm on;
setm(gca,'MLabelParallel',-20)
pcolorm(latmesh(1:48,:),lonmesh(1:48,:),DataZ')
shading interp;
geoshow(coastlat,coastlon)
axis off
set(gca,'xtick',[],'ytick',[])
title('Z','fontsize',14)
set(gca,'FontSize',12)
caxis([-15,15])
colormap redblue
I am able to get the desired hatched region on a normal contour plot (See below).
figure(2);
[C,h]=contourf(latmesh,Ymesh,DataZ)
set(h,'linecolor','none')
hold on
box on
title('Y','fontsize',14)
set(gca,'FontSize',12)
caxis([-6,6])
colormap redblue
xlabel('lat (°)')
figure(2);
[c1,h1]=contourf(latmesh,Ymesh,DataZsig,[2.5 2.5]-10);
set(h1,'linestyle','none','Tag','HatchingRegion');
ax1=gca;
hp=findobj(ax1,'Tag','HatchingRegion');
set(h1,'linestyle','none');
However, When I try to use this method with the polar contour map, it does not work.
Does anyone have any suggestions on how to make this work?
Thank you!

回答 (2 件)

Chad Greene
Chad Greene 2019 年 2 月 15 日
For anyone who wants to do this with Antarctic Mapping Tools, you may be able to use my stipple function. For a lat,lon grid and corresponding mask, just convert lat,lon to x,y and then use stipple like this:
[x,y] = ll2ps(lat,lon);
stipple(x,y,mask)

Mark Brandon
Mark Brandon 2019 年 1 月 23 日
Hi Holly,
What's your latmesh, longmesh and Ymesh?
Also you're plotting Antarctica. Do you use the Antarctic Mapping Tools toolbox?
Mark
  2 件のコメント
HA
HA 2019 年 1 月 24 日
Hi Mark,
The mesh variables are grids of lat and lon, and for the one that works it is a lat and height grid. I think the problem is in the difference between contourf pcolourm.
Yes, I originall did the polar maps with the Antarctic Mapping toolbox, but found the method above to give me better plots. When I used the Antarctic Mapping toolbox I had simialr problems with plotting hatched markings (unable to call upon h1 as I am in the plot that works).
Holly
Mark Brandon
Mark Brandon 2019 年 2 月 1 日
What a drag. Sorry not easy to solve.

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeGlaciology についてさらに検索

製品


リリース

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by