How to change background color of a surf

48 views (last 30 days)
Hello everyone, I have a surface obtained with the surf command. I would like to extract an image from it. In particular I would like to set a colored background, without the axis visible.
The only thing I know to achieve this stuff is:
surf(x,y,z)
view(2)
ax = gca; set(ax,'Color','k');
The problem is that if I remove the axis with:
ax.Visible = 'off'
the background color disappear.
I woould like to obtain the same image, without the axes.
  2 Comments
Ameer Hamza
Ameer Hamza on 5 Oct 2020
Can you show an image of what type of output image you want?

Sign in to comment.

Accepted Answer

Ameer Hamza
Ameer Hamza on 5 Oct 2020
Just turn the visibility of both axis off
ax.XAxis.Visible = 'off';
ax.YAxis.Visible = 'off';
  6 Comments

Sign in to comment.

More Answers (1)

KSSV
KSSV on 5 Oct 2020
pcolor(x,y,z)
axis off
% box on
% shading interp
% colorbar
  1 Comment
Carmine Buonagura
Carmine Buonagura on 5 Oct 2020
x,y and z are the coordinates for the surface. This function doesn't allow me to generate a black background

Sign in to comment.

Community Treasure Hunt

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

Start Hunting!