Save figure with black background and window
97 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
V.D-C
el 24 de Feb. de 2020
Comentada: Lucian
el 3 de Dic. de 2023
Hello everybody,
I have several figures with black background, and I would like to save them and do something similar to the figure I link in this message (credits to A.Wherlé for the image).
How to get rid of the classic white or grey contour of the matlab window when I use save() ?
Thank you in advance and have a good day !
1 comentario
Adam
el 24 de Feb. de 2020
Does it not save the figure in the colour you give it?
e.g.
hFig = figure;
hFig.BackgroundColor = 'k';
and similar for axes if you want them black too.
Respuesta aceptada
Samatha Aleti
el 27 de Feb. de 2020
Hi,
According to my understanding you have MATLAB figure and want to change the background color of the figure and save(preserving the background). You can change the background color by setting the color using “set” and save to required format using “saveas”. Here is a sample code:
f = figure;
surf(peaks);
set(gcf, 'InvertHardCopy', 'off');
set(gcf,'Color',[0 0 0]); % RGB values [0 0 0] indicates black color
saveas(gcf,'Peaks.png'); % save as .png file
2 comentarios
Más respuestas (0)
Ver también
Categorías
Más información sobre Printing and Saving en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!