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

MATLABopengl

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)

Best Answer

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.
Related Question