Change Plot background color and save to file

73 visualizzazioni (ultimi 30 giorni)
Hello again,
I have multiple plots and I want to have a gray background for them. I have tried:
set(gca,'color','gray')
print(f(1),num2str(SavePath),'-dmeta');
This works in the figure window but when I save the figure with print the saved plot has a white background.
As always any help is greatly appreciated.

Risposta accettata

leonidas86
leonidas86 il 13 Giu 2018
It works with:
set(gcf, 'InvertHardCopy', 'off');

Più risposte (1)

Sai Deepesh Pokala
Sai Deepesh Pokala il 8 Giu 2018
Try getframe() or export_fig('') after the set gca step.

Categorie

Scopri di più su Animation in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by