Change Plot background color and save to file

53 次查看(过去 30 天)
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.

采纳的回答

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

更多回答(1 个)

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

类别

Help CenterFile Exchange 中查找有关 Annotations 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by