How to change background color of a surf

42 Ansichten (letzte 30 Tage)
Carmine Buonagura
Carmine Buonagura am 5 Okt. 2020
Kommentiert: Ameer Hamza am 6 Okt. 2020
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 Kommentare
Ameer Hamza
Ameer Hamza am 5 Okt. 2020
Can you show an image of what type of output image you want?
Carmine Buonagura
Carmine Buonagura am 5 Okt. 2020
Of course, I will edit my question

Melden Sie sich an, um zu kommentieren.

Akzeptierte Antwort

Ameer Hamza
Ameer Hamza am 5 Okt. 2020
Just turn the visibility of both axis off
ax.XAxis.Visible = 'off';
ax.YAxis.Visible = 'off';
  6 Kommentare
Carmine Buonagura
Carmine Buonagura am 5 Okt. 2020
aaaaah yes, thank you a lot
Ameer Hamza
Ameer Hamza am 6 Okt. 2020
I am glad to be of help! :)

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (1)

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

Melden Sie sich an, um zu kommentieren.

Community Treasure Hunt

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

Start Hunting!

Translated by