How to output figures with light theme or white background while using dark mode?

215 views (last 30 days)

I enjoy the dark theme of MATLAB Desktop in R2025a for coding. However, when saving, exporting, or publishing plots, I want the output figures to have white background from the light theme. How can I achieve this?

Accepted Answer

MathWorks Support Team
MathWorks Support Team on 29 Jul 2025
In MATLAB R2025a, by default, the colors of figures automatically match the selected MATLAB desktop theme. However, you can override the desktop theme for figures. 
To do this:
  1. On the Home tab, in the Environment section, click the Settings icon.
  2. Select MATLAB > Appearance.
  3. In the Figure Theme list under Graphics and Apps, select Light.
This way you set the theme of all figures, and your settings persist across MATLAB sessions. The figures you save, export, or publish will have the white background in light theme even though you are using the dark theme for the MATLAB desktop.
Alternatively, you can use the "theme" function to create a figure with a specific theme. You can also set the theme of a figure by setting the "Theme" property of the "Figure" object, or by selecting a theme in the Figure toolstrip. Such changes are specific to the figure and will not persist across MATLAB sessions. For detailed information, see https://www.mathworks.com/help/releases/R2025a/matlab/creating_plots/graphics-and-app-themes.html.

More Answers (0)

Categories

Find more on App Building in Help Center and File Exchange

Products


Release

R2025a

Community Treasure Hunt

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

Start Hunting!