Axis 'boxstyle' 'full' only works if 'xaxislocation' is 'origin'!!

9 views (last 30 days)
Luc Masset
Luc Masset on 24 Jan 2018
Answered: Jordy Jose on 31 Jan 2018
Another one ...
Try this:
figure;surf(peaks);view(2);axis tight;shading interp;box on
Now try:
And that's ok!
I'm on Matlab R2017b under Windows 10 64 bits

Answers (1)

Jordy Jose
Jordy Jose on 31 Jan 2018
Hi Luc,
The box is actually there but the surface is being rendered on top of it (because the axis is tight). You can render the rulers on top of the surface by setting the layer to 'top' on the axes.
a = gca; a.Layer = 'top'
Another workaround is to keep the rulers on layer 'bottom,' but increase the LineWidth of the axes. A value of 1.5 or greater should work.

Community Treasure Hunt

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

Start Hunting!