Why do the axes box and tick marks disappear when I use transparency in a plot in MATLAB 7.5 (R2007b)?

4 views (last 30 days)
When I create a plot with a textbox object and set the 'FaceAlpha' property of the textbox to a value smaller than 1, the current axes box and tick marks disappear, mostly at the right side and at the top.

Accepted Answer

MathWorks Support Team
MathWorks Support Team on 18 Oct 2013
This is an issue with the 'OpenGL' renderer installed in the system. When using transparency in a plot the figures renderer is automatically set to OpenGL. This renderer often clips the axes box and tick marks.
To work around this issue, you can make the axes box visible by slightly changing the camera target of the axes:
ct = camtarget;
camtarget([ct(1)+0.001*ct(1) ct(2)+0.001 ct(3)]);
To make the tick marks at the right side and top visible you can overlay another axes object with the same settings as the other axes, empty its ticklabels and set the axis locations to the right and top of the axes:
ax2 = copyobj(gca,gcf);
set(ax2,'XAxisLocation','top','XTickLabel','','YAxisLocation','right','YTickLabel','','Color','none')

More Answers (0)

Categories

Find more on Graphics Performance in Help Center and File Exchange

Products


Release

R2007b

Community Treasure Hunt

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

Start Hunting!