Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Black lines missing in the box holding the axes of a MATLAB plot

Tags:

plot

matlab

When plotting on a figure in MATLAB, I have noticed that parts of the black box that holds the axes are missing (the left and bottom one):

              enter image description here

I have tried issuing:

box off
box on

commands with no success. Do you know what I can do to get the corresponding black lines on the axes?

Note:

I am using the OpenGL renderer:

set(0,'DefaultFigureRenderer','opengl');
like image 597
Amelio Vazquez-Reina Avatar asked Mar 19 '12 17:03

Amelio Vazquez-Reina


3 Answers

It looks like you have known issues with OpenGL renderer:

  • Why do the axes box and tick marks disappear when I use transparency in a plot in MATLAB 7.5 (R2007b)?
  • Why does using PATCH with transparency cause the axes to disappear in MATLAB?
  • Why does the ALPHA commmand make the top and right borders of my figure disappear in MATLAB R2011a (7.12)?

Let us know what you did exactly to create this figure.

like image 167
yuk Avatar answered Oct 18 '22 22:10

yuk


Try increasing the line width of the axes a bit:

set(gca, 'LineWidth', 1.2)

Also, switching from hardware (default) to software rendering may solve the problem:

opengl software

However, there may be drawbacks. Increasing the line width, e.g., changes all axes lines, including ticks.

like image 31
Dirk Avatar answered Oct 19 '22 00:10

Dirk


Use the following line of code to make the black lines appear

set(gca,'Layer','top')

like image 20
Will Cousins Avatar answered Oct 18 '22 23:10

Will Cousins