MATLAB Answers

mirrored axes labels with imagesc

7 ビュー (過去 30 日間)
Jette
Jette 2012 年 3 月 2 日
コメント済み: Image Analyst 2014 年 9 月 8 日
Hi,
when I execute the following code
a = rand(5,5)
a(3,3) = NaN
figure
imagesc(a,'AlphaData',double(~isnan(a)))
I get mirrored axes labels and also the data cursor info is mirrored. Does anybody know why and how to avoid it?
I use MATLAB R2010b on Win XP.

採用された回答

Jette
Jette 2012 年 3 月 8 日
The MathWorks support says this is a known problem of some ATI graphics devices. Updating the driver for the graphic device didn't help in my case. It is possible to switch the OpenGL renderer by
opengl('software')
This sovles my problem.
Thanks for your help!

その他の回答 (4 件)

Jarrod Rivituso
Jarrod Rivituso 2012 年 3 月 2 日
Are you referring to the y-axis being in reverse direction? If so, you can set it back...
a = rand(5,5)
a(3,3) = NaN
figure
imagesc(a,'AlphaData',double(~isnan(a)))
set(gca,'YDir','normal')
  3 件のコメント
Walter Roberson
Walter Roberson 2012 年 3 月 2 日
I *have* heard of the characters being backwards, but not for R2010b on XP. It was an earlier problem on a different OS -- OS-X is what comes to mind.
Oh, dang I'm good :) R2008a on Snow Leopard. http://www.mathworks.com/support/bugreports/585050

サインインしてコメントする。


Image Analyst
Image Analyst 2012 年 3 月 2 日
Jette, it's doing exactly as designed. With images, the generally accepted convention is that the top line is 1 and the bottom row of pixels is row N. That is exactly what you are getting. See how your axis tick marks have "1" right at the center of your top row? That's the way it is supposed to be. Note that this is different that what you get by doing a line plot with plot() or a bar chart with bar().
  4 件のコメント
Jan
Jan 2012 年 3 月 4 日
support@mathworks.com, without "i".

サインインしてコメントする。


Jan
Jan 2012 年 3 月 4 日
Some OpenGL drivers have this known bug, that the text is mirrored. If you have tried already to install the newest graphics drivers, this is a workaround:
feature('UseGenericOpenGL', 1)
Because this is not completely documented, this might change with the Matlab release. In Linux it might be:
feature('UseMesaSoftwareOpenGL', 1)
See:
help opengl
opengl info

Shreesha Vitthala
Shreesha Vitthala 2014 年 9 月 8 日
The command "opengl AUTOSELECT" worked for me...
  1 件のコメント
Image Analyst
Image Analyst 2014 年 9 月 8 日
Worked how? Do you mean it prevented the mirror image? Where exactly in the code did you insert this function?
By the way, since I answered this two and a half years ago, I did observe it on one person's computer. It was fine on my computer and another one but one scientist had the mirror image. I changed the renderer of the figure in GUIDE to zbuffer and that fixed the problem. It also changed the colors (e.g. yellow was more vivid) for some reason.

サインインしてコメントする。

Community Treasure Hunt

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

Start Hunting!

Translated by