pcolor/m_pcolor cannot create world map correctly

조회 수: 3 (최근 30일)
Rong Yu
Rong Yu 2015년 5월 26일
댓글: Chad Greene 2015년 6월 9일
Hello all,
I have an issue to create world mean temperature map correctly with pcolor/m_pcolor. There are strips on the map created. Please see the first map.
h1 = pcolor(lon,lat,statTa(:,:,i)); set(h1,'edgecolor','none'); colorbar;
When I use imagesc, it shows pretty well. Please see the second map. But I think I prefer to use pcolor/m_pcolor to create map since they are more powerful on creating maps. Please help me on what happened when I was using pcolor here. Thank you very much!
h2 = imagesc(lon,lat,statTa(:,:,i)); set(gca,'ydir','normal'); colorbar;
  댓글 수: 11
Mike Garrity
Mike Garrity 2015년 6월 9일
What version of MATLAB are you using? That looks like an issue that was fixed in R2014b. Is your version older than that, or newer?
Rong Yu
Rong Yu 2015년 6월 9일
Hi Mike, it is R2014a.

댓글을 달려면 로그인하십시오.

채택된 답변

Chad Greene
Chad Greene 2015년 6월 9일
This question has been answered in the comments above, but in case anyone else runs into this problem again, here's an easier-to-find version of the solution. This is a rendering issue in Matlab versions pre-R2014b. Type
set(gcf,'renderer','opengl')
If that doesn't work, try
set(gcf,'renderer','painters')
and if that doesn't work, try
set(gcf,'renderer','zbuffer')
  댓글 수: 1
Chad Greene
Chad Greene 2015년 6월 9일
Rong, if this solution worked for you, please click "Accept this answer" so it'll get top-posted.

댓글을 달려면 로그인하십시오.

추가 답변 (1개)

Chad Greene
Chad Greene 2015년 6월 8일
I see that when you use pcolor your axis values are not lat,lon values. Looks like linear indices of rows and columns. Are you sure you're plotting lat and lon?
  댓글 수: 2
Rong Yu
Rong Yu 2015년 6월 8일
A good catch! I tried to plot lon,lat one and the one without lon, lat, but the figures have the same problem. Thank you so much for helping me with this!
Rong Yu
Rong Yu 2015년 6월 8일
Hi Chad,
You are so excellent at matlab coding! Do you mind sharing your tips and recommending some good matlab coding resources? Thank you :)))

댓글을 달려면 로그인하십시오.

Community Treasure Hunt

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

Start Hunting!

Translated by