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

Yash
Yash 2012년 11월 16일
which vesion r u using??
Jan
Jan 2012년 11월 16일
편집: Jan 2012년 11월 16일
I love your picture! I did not know that the Modern Art Toolbox is available yet. The fact, that the background color is changed is an additional goodie.
Daniel Shub
Daniel Shub 2012년 11월 16일
Have you overloaded some key function or set a weird default for your axis?
Jan
Jan 2012년 11월 16일
편집: Jan 2012년 11월 16일
@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 2012년 11월 16일
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.

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

 채택된 답변

Jan
Jan 2012년 11월 16일

18 개 추천

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

Thank you soooo much :-) Your suggestion worked!! Both
set(gcf, 'renderer', 'zbuffer');
and
opengl software
Fixed my problem. If I set opengl back to hardware the problem reappears. I guess this suggests that it is a driver problem? My drivers were from windows update, and I tried updating to the newest drivers from intels website (Intel HD Graphics 4000 chip), but with the same results. I doubt i will need hardware acceleration for my applications though, so this solution is good for me. Could be interesting to know what was wrong though, since i cant fix it with a driver update.
At any rate you saved me a lot of work with this simple fix.... thanks a lot :)
Jeff Parker
Jeff Parker 2012년 11월 22일
편집: Jeff Parker 2012년 11월 22일
Boy am I glad for this question! I have the same graphics chip and had the same problem. I tried looking for a solution a couple weeks ago but couldn't find anybody with the same problem. Thankfully, the above solutions do the trick.
Daniel Shub
Daniel Shub 2012년 11월 23일
편집: Image Analyst 2012년 11월 23일
@Jeff please submit this as a bug to TMW.
Jeff Parker
Jeff Parker 2012년 11월 27일
편집: Jeff Parker 2012년 11월 27일
@Daniel done. They responded by saying they couldn't do anything since it was a hardware bug and related to the hardware driver.
Chih-Wei
Chih-Wei 2013년 4월 8일
This works for me! Thanks dude!
Eowyn Baughman
Eowyn Baughman 2013년 6월 13일
That saved me, too! THANKS! My figure was saving great, then when you added a colorbar the saved or printed figure was completely messed up. This fixed it :-D
Yueyue
Yueyue 2014년 5월 8일
The same problem from my matlab, and this helped me, too, thanks!
Mukund Rao
Mukund Rao 2014년 7월 3일
이동: DGM 2023년 3월 5일
Thank you!
Syed Ahsan
Syed Ahsan 2015년 7월 20일
이동: DGM 2023년 3월 5일
Thank you, it worked for me as I was facing the similar issue.
Mohamed Mansoor Viyathukattuva Mohamed Ali
이동: DGM 2023년 3월 5일
Thank you Jan Simon I had same problem and your answer helped me.
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

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

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Graphics Performance에 대해 자세히 알아보기

태그

질문:

2012년 11월 16일

이동:

DGM
2023년 3월 5일

Community Treasure Hunt

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

Start Hunting!

Translated by