MATLAB Answers

Why are the numbers on my figure axes upside-down when I try to superimpose a PATCH object onto an image using MATLAB 7.9 (R2009b)?

11 views (last 30 days)
I want to superimpose a semi-transparent PATCH object on an image, but the numbers on axes are mirrored and upside-down in MATLAB 7.9 (R2009b).
Reproduction Steps:
A = imread('cameraman.tif');
figure('Renderer','OpenGL');
imagesc(A);
patch([100 150 150 100],[150 150 100 100],'k','FaceAlpha',.25)

Accepted Answer

MathWorks Support Team
MathWorks Support Team on 20 Aug 2010
The upside-down numbers in figure axes can be resolved by changing the OPENGL renderer in MATLAB 7.9 (R2009b).
The mirrored axes might be caused by the hardware version of the OPENGL renderer. To determine if this is the case, set MATLAB to use the software version of the OPENGL renderer as below:
opengl software
Now, generate image superimposed with a semi-transparent patch, for example:
A = imread('cameraman.tif');
figure('Renderer','painters');
imagesc(A);
patch([100 150 150 100],[150 150 100 100],'k','FaceAlpha',.25);
You can check if the “Renderer” is “Generic” (software OpenGL) by executing:
opengl info
If the axes show correct numbered labels after following the steps above, then the issue is with the hardware version of OpenGL rendering. You may be able to resolve the issue by updating the graphics card drivers.

More Answers (0)

Tags

Products


Release

R2009b

Community Treasure Hunt

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

Start Hunting!