How do I turn off white figure background when exporting? (Permanently)

15 views (last 30 days)
I'm trying to save images from the commandline. Because i generally use darkmode; I have this is my startup.m;
% Default axis coloring
colordef('black');
So my figures are plotted with black background; which is what I like. I also want to export the figures with the black background. From the figure window; i go to File -> Export Setup -> Rendering and untick the Custom Color box to export with my background. However; I can't do in individually for every figure. Is there a way I can set this option as the default?

Answers (1)

Srivardhan Gadila
Srivardhan Gadila on 10 Apr 2020
A list of factory-defined graphics settings that can be manipulated can be obtained by executing this command at the MATLAB prompt:
get(0,'Factory')
To set the default color for all graphics objects, the 'defaultfigurecolor' property of the ROOT graphics object needs to be defined as follows:
set(0,'defaultfigurecolor',[1 1 1])
Once the property is set, all succesive figures created will inherit this property from the ROOT graphics object.

Categories

Find more on Printing and Saving in Help Center and File Exchange

Products


Release

R2019b

Community Treasure Hunt

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

Start Hunting!