Plotting surfacem on top of worldmap/geoshow

조회 수: 12(최근 30일)
Jani Puttonen
Jani Puttonen 2016년 10월 2일
댓글: Dong An 2018년 3월 28일
I have Matlab 2016a with mapping toolbox. I'm trying to plot a world map and place some geographic data (some latitude/longitude grid data) on top of that with surfacem/pcolorm or similar. Everything works nicely, when I plot only the worldmap by itself or the surfacem/pcolorm plot by itself. However, when I try to plot them to the same figure, it shows only the latter plot. Thus, it seems that the latter plot overlaps and covers the first plot. I have tried to "hold on" after the first plot, but it does not have any effect. Any suggestions? Is there some way of making the plots transparent or something? I nave succeeded in making such a figure couple of years back, but now for some reason with no success.


Amy Haskins
Amy Haskins 2016년 10월 3일
I suspect you're right about it being a stacking problem where the surface is hiding the other items on the map. If you save a handle to the surface when you call surfacem or pcolorm, you can use the uistack function to bring the surface to the bottom, making the other layers visible.
hSurf = surfacem(lat, lon, Z);
If you want the surface to be semi-transparent for some other reason, you can use the FaceAlpha property.
hSurf = surfacem(lat, lon, Z, 'FaceAlpha', 0.5);
  댓글 수: 1
Dong An
Dong An 2018년 3월 28일
Thanks Amy, im having the same question and 'FaceAlpha' really helps.

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

Community Treasure Hunt

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

Start Hunting!

Translated by