Output figure as white background in dark mode [2023b beta]
315 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
Dear all,
I appreciate for dark mode in 2023b version. However, for the output figure, my output figure works also based on dark mode which means black background and white text color. I take effort to change into "white mode" figure (white background, black text color). I used below code but it just work for one-by-one figure.
set(gca, 'Color','w', 'XColor','k', 'YColor','k')
set(gcf, 'Color','w')
set(gca,XScale='log');
colorPropObjs = findobj(gcf, "-property", "Color");
colorPropObjs(2).Color = [1.0000 1.0000 1.0000];
set(0,'defaultfigurecolor',[1 1 1]);
I would like to ask there are any ways to work on dark mode but the output figure as normal as white mode. or we can set up output figure at one time.
Thank you for your time,
Best regards,
0 Commenti
Risposta accettata
Adam Danz
il 12 Ott 2023
Modificato: Adam Danz
il 22 Apr 2024
To be clear, Hoang-Long is using the R2023b beta version of the new desktop for MATLAB which can be downloaded from the file exchange (link). The themes features and behaviors described in the question and this answer are only relevant for the beta version in R2023b.
Setting the theme for an existing figure in R2023b Beta desktop
Set the Theme property of the figure (fig) to light or dark
fig.Theme = "dark";
% or
fig.Theme = "light";
Setting the default theme for existing and future figures in R2023b Beta desktop
s = settings;
s.matlab.appearance.figure.GraphicsTheme.TemporaryValue = "light";
% or
s.matlab.appearance.figure.GraphicsTheme.TemporaryValue = "dark";
This setting will persist until it's cleared, changed, or until MATLAB shuts down. This setting will not persist between MATLAB sessions. To clear the TemporaryValue,
clearTemporaryValue(s.matlab.appearance.figure.GraphicsTheme)
We are interested in hearing about your experience with themes and any issues or questions you run into.
6 Commenti
Adam Danz
il 22 Apr 2024
Hi @Jack, I downloaded and installed the 24a release with the beta desktop and could not reproduce what you're describing. Here are the steps I took. Please let me know if you see anything unexpected when following these steps or provide a different set of steps that I can follow to produce the problem.
- My desktop is set to dark theme.
- I ran s = settings; s.matlab.appearance.figure.GraphicsTheme.TemporaryValue = "light";
- I called plot(magic(5))
The figure appeared as light as expected.
The "hit-or-miss" part of your description makes me suspicious that this is happening on figures with manually set colors. For example, if the axes color is manually set to some dark color, then switching the default figure theme to light will not affect the color of the axes.
Jack
il 26 Apr 2024
Hi @Adam Danz, I did as you said and got the same result of the light figure. However, I don't think i've manually set any axes colors for any of the affected plots. Like I said, it's intermittently happening for me, so I'll let you know if I run to this issue again in the future.
Vedere anche
Categorie
Scopri di più su Graphics Performance in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!