shamalaia
shamalaia

Reputation: 2351

matlab 'box' overlays to plot

The following code

figure;
plot3(rand(1,1000),rand(1,1000),rand(1,1000),'.')
box on

produces this output:

I do not like that the box lines overlay to the plot.

I would like to not show the box lines in the foreground (e.g. (0,1,1)->(0,0,1)) while still showing the other ones (e.g., (0,1,0)->(1,1,0)). Does anyone know how to do it?

Upvotes: 0

Views: 161

Answers (1)

bushmills
bushmills

Reputation: 673

since MATLAB version R2015b you can control the Box by The BoxStyle-property:

ax = gca;
ax.BoxStyle = 'back';

or

figure;
plot3(rand(1,1000),rand(1,1000),rand(1,1000),'.')
box on
set(gca, 'BoxStyle','back')

for older versions you can use the grid with solid line-style instead:

figure;
plot3(rand(1,1000),rand(1,1000),rand(1,1000),'.')
grid on
set(gca,'GridLineStyle','-')

Upvotes: 2

Related Questions