Colorbar error - how to fix it?

41 views (last 30 days)
Mikkel
Mikkel on 16 Nov 2012
Moved: DGM on 5 Mar 2023
I am currently experiencing problems with the matlab colorbar. In the beginning i thought it was an error with my script, but now i am convinced it is an error with matlab since even the most basic uses yields this error. It must be something interacting with matlab, because the error is unique to this machine and didnt always occur on this machine. I have tried uninstalling and installing the same version of matlab and even a never version to be sure, with no luck.
The error presents itself as many numbers being printed on the colorbar instead of what is expected. For example:
surf(peaks(30))
Gives this figure:
however when i click the colorbar button or use the command
colorbar
I get this figure:
It is very weird to me since it is so basic (i only need two commands to make this error). It should be noted if i try to save the figure as an image it will save the right figure, but with no colorbar or numbers. That is why i took the screenshot for the second figure. Anyone have any idea as to what might be causing this? I am at the point now where i am seriously considering reformatting my computer because of this, but it would be nice to at least have an idea as to what could be causing this, to make sure it doesnt just happen again in the future.
Kind regards, Mikkel Gram
  5 Comments
Jan
Jan on 16 Nov 2012
Edited: Jan on 16 Nov 2012
@Daniel: Overloading built-in function appeared three times today already. You hit a critical point: The more functions are included in Matlab's toolboxes, the more likely is a collision. For a reliable code creation, the programmer needs a tool to detect collisions urgently. There are some mechanisms already, e.g. when you include a new folder to the path a warning appears when a built-in function is shadowed. But this does not work reliably.
Mikkel
Mikkel on 16 Nov 2012
it is very alternative but i am afraid most journals these days are not ready for this level of artistic expression in their publications :) I know no functions have been overloaded as i tried it from clean install and removed all functions from the path.

Sign in to comment.

Accepted Answer

Jan
Jan on 16 Nov 2012
This could be cause by the OpenGL driver. Did you install the newest drivers of your graphics cards?
Workaround might be:
set(gcf, 'renderer', 'zbuffer');
or if OpenGL looks nicer:
opengl software
or perhaps:
opengl hardware
Look for "OpenGL" in the documentation to find a bunch of switches to consider a bunch of driver bugs.
  11 Comments
Mohamed Mansoor Viyathukattuva Mohamed Ali
Moved: DGM on 5 Mar 2023
Thank you Jan Simon I had same problem and your answer helped me.
Mike Garrity
Mike Garrity on 7 Aug 2015
Could you do
opengl info
please and send the output into us at the MathWorks please. It sounds like a driver issue, but it doesn't look like one I've seen before.
You can just send it to the support team .
Thanks

Sign in to comment.

More Answers (0)

Categories

Find more on Graphics Performance in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!