Change Plot background color and save to file

43 ビュー (過去 30 日間)
leonidas86
leonidas86 2018 年 6 月 8 日
コメント済み: Tomas 2025 年 3 月 25 日
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 件のコメント
Tomas
Tomas 2025 年 3 月 25 日
THANKS!

サインインしてコメントする。

その他の回答 (1 件)

Sai Deepesh Pokala
Sai Deepesh Pokala 2018 年 6 月 8 日
Try getframe() or export_fig('') after the set gca step.

カテゴリ

Help Center および File ExchangeAnimation についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by