Change Plot background color and save to file

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일

8 개 추천

It works with:
set(gcf, 'InvertHardCopy', 'off');

추가 답변 (1개)

Sai Deepesh Pokala
Sai Deepesh Pokala 2018년 6월 8일

0 개 추천

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

카테고리

도움말 센터File Exchange에서 Annotations에 대해 자세히 알아보기

질문:

2018년 6월 8일

댓글:

2025년 3월 25일

Community Treasure Hunt

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

Start Hunting!

Translated by