PCOLOR appearance/shading changes when PLOT items are on the same axes!?

Hi,
This one is really baffling me. I am plotting a regularly gridded bathymetry dataset using pcolor and then overplotting markers where I have sampled oceanographic data using the plot command as follows:
h=pcolor(lon,lat,depth);
set(h,'linestyle','none');
shading interp;
hold;
h1=plot(lon_CTD,lat_CTD,'kd','markeredgecolor','w','markerfacecolor','k','markersize',4);
The above works fine, but if I remove the markers either using the plot editor of delete(h1), the shading/style of the pcolor image becomes messy and distorted. If I add the markers again it returns to looking corectly shaded. It is almost as if when the plot objects are removed, the shading becomes part "flat" and part "interp"! I odnt understand why the appearance of the pcolor object changes at all.
Many thanks Ziggy

 Accepted Answer

Less than a day ago, someone had a similar problem that was solved for them by switching
set(gcf, 'renderer', 'zbuffer')

3 Comments

Thanks, that does work. It begs the question, "Do different plotting/graphics commands switch the renderer property or does the renderer stay as the default unless manually changed as directed by your answer?" The Painters (vector) seems to be the default renderer for my figures. I prefer to export figures as vector files, unless there is alot of filled contours/pcolor or surface objects in which case I tend to chose a raster rendered format, but I thought this was just for exporting and not related to the image drawn on the screen.
Anyway thanks again your answer has solved my problem.
Normally, the Renderer changes automatically. (This is especially the case if you invoke something with transparency as only OpenGL handles transparency.)
Thanks again Walter. Such things are really interesting to know especially when trying to get my all important figures exported in a form suitable for publication without losing any quality/information.

Sign in to comment.

More Answers (0)

Community Treasure Hunt

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

Start Hunting!