Contourm, geoshow, and layering issues (R2012b) change

1 回表示 (過去 30 日間)
DaveD
DaveD 2013 年 5 月 30 日
I'm having some problems with contourm and geoshow.
This code produces the intended output, which is a contour map overlaid on top of a map of North America.
if true
%Generate some peak data
lats = 35:54;
lons = -89:-70;
mval = peaks(20);
%make the world map
H1 = worldmap([25 55],[-90,-60]);
setm(gca,'mapprojection','mercator')%,'meridianlabel','off');
coast = load('coast');
states = shaperead('usastatehi', 'UseGeoCoords', true);
geoshow(coast.lat,coast.long);
%geoshow(coast.lat,coast.long,'DisplayType', 'polygon', 'FaceColor', [.45 .60 .30],'edgecolor','black')
%Plot the contours of the data
contourm(lats,lons,mval,'linewidth',2);
end
However, if change to the uncommented geoshow line, which fills in the coastline data to make the land green, the land mass appears to be plotted over the contour plots:
if true
%Generate some peak data
lats = 35:54;
lons = -89:-70;
mval = peaks(20);
%make the world map
H1 = worldmap([25 55],[-90,-60]);
setm(gca,'mapprojection','mercator')%,'meridianlabel','off');
coast = load('coast');
states = shaperead('usastatehi', 'UseGeoCoords', true);
%geoshow(coast.lat,coast.long);
geoshow(coast.lat,coast.long,'DisplayType', 'polygon', 'FaceColor', [.45 .60 .30],'edgecolor','black')
%Plot the contours of the data
contourm(lats,lons,mval,'linewidth',2);
end
I am running version 2012b on a windows 7 machine. When I try this in the linux system (R2012a), the second set of code produces the expected output. Any thoughts?

採用された回答

Rob Comer
Rob Comer 2013 年 6 月 16 日
The platform-specific nature of this problem makes me think about graphics rendering. I can reproduce the problem in R2013a on my Macintosh when, as in your script, I allow MATLAB to choose the default renderer. In this case that is painters:
>> get(gcf,'Renderer')
ans =
painters
The behavior is the same with opengl. But when I explicitly set the renderer to zbuffer, the plot looks correct:
>> set(gcf,'Renderer','zbuffer')

その他の回答 (0 件)

カテゴリ

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

Community Treasure Hunt

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

Start Hunting!

Translated by