I was getting issues with colorbar in some of my work, so I went in to dig in the issue, and found out that surf and colorbar have weird behaviors for low values. I am using the student version 7.14.0.739 (R2012a). When I type :
surf(peaks(30))
It's all good and I get the expected plot :
But when I use a (much) smaller peaks, like in
surf(1e-7 * peaks(30))
I get no surface displayed, as below :
While pcolor still works fine, colorbar however cannot keep up, and only half of it appears in the wrong position, as in
pcolor(1e-7 * peaks(30))
colorbar
gives the following :
I am unsure but do not think the issue happens on non-student versions. Anyway, a little info on how to deal with it (apart from playing around with bigger values and renaming colorbar ticks) would be much appreciated.

 Réponse acceptée

Looks like an OpenGL issue. Try
set(gcf, 'renderer', 'zbuffer');
You can read up more on this, and possibly find some workarounds, here: http://www.mathworks.com/help/matlab/ref/figure_props.html#Renderer

2 commentaires

Benoit
Benoit le 8 Oct 2013
Your solution works like a charm! I had seen it before but did not think about trying it...
Thank you very much for your quick and very efficient answer!
Chad Greene
Chad Greene le 11 Mar 2014
This helped me too--thanks Kelly!

Connectez-vous pour commenter.

Plus de réponses (0)

Produits

Community Treasure Hunt

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

Start Hunting!

Translated by