MATLAB: Change Plot background color and save to file

backgroundcolorgrayplotprint

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.

Best Answer

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