colorbar floods 3dplots with text
Info
This question is closed. Reopen it to edit or answer.
Show older comments
If I run the following code
x=zeros(18,18); figure;surf(x);colorbar
I get a plot of a flat plane with a nicely behaved colorbar on the right side of the plot and a scale of numbers next to the colorbar showing the values associated with specific colors.
If I run this code instead (only thing that has changed is the dimension of the matrix)
x=zeros(18,19); figure;surf(x);colorbar
I still get a plot of a flat plane but now the entire field of the plot is filled with numbers that appear to be duplications of the scale values.
Any ideas what has gone wrong? I am using Matlab 2012 a
I still see a nice plane, but the entire
Answers (1)
Kelly Kearney
on 19 Jun 2013
Perhaps you could add a screenshot of what you see? Both lines of code produce the expected plane with colorbar plot on my system (also R2012a)... no errant text that I can see.
Without any other details, I might guess that it's an OpenGL rendering issue (most bizarre graphics display issues can be attributed to that). Does
set(gcf, 'renderer', 'zbuffer')
fix things?
3 Comments
Mark
on 19 Jun 2013
Sean de Wolski
on 19 Jun 2013
What OS are you on?
You can run:
>>opengl software
which will use the software implementation of OpenGL to avoid the various hardware bugs. Putting this in the startup file will make it persist.
Kelly Kearney
on 19 Jun 2013
If you're on a Mac (where switching to software opengl isn't an option), you can run
opengl('neverselect')
instead, which causes Matlab to use zbuffer instead of opengl for appropriate figures.
This question is closed.
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!