Restore Default Font Colors of Figures
20 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Nicholas Scott
el 8 de Mayo de 2023
Comentada: Nicholas Scott
el 8 de Mayo de 2023
Hi All,
I did something that was rather unfortunate when scouring code in mathworks, while trying to understand what some code did, I was typing it into my command line a while ago. In the process it changed my default coloring of the background of my figure (which I promptly fixed), and global text color in matlab.
This is a current example of the figure is the png attachment 'Alexa_t_AllCells.png'. and the 'XandYColorChange.png' is an example of what I am looking for on a global scale. My code for making the figure is rather simple: see below.
figure
heatmap(log10(T_Alexaheat), table2cell(U_3), table2cell(U_3), ...
'%0.2f', 'TickAngle', 45, 'Colormap', redblue(30), ...
'Colorbar', true)
title('Log 10 Relationships of Median T_{1/2} Alexa Note: (x/y)')
%% this is for the second picture %%
ax = gca;
ax.XColor = 'k';
ax.YColor = 'k';
I figured a simple
set(groot, 'defaultFontColor' or 'defaultTextColor', 'k')
or
reset(gcf)
would get me to what I need, but that doesn't work. The second picture is not correct either, as I need the color bar and title to be readable, and I do not want to have to repeat the same code for every figure I create from hereon.
How does one fix this? (note that groot, defaultTextColor, 'k' will only cause the title to become black, not the axes nor the color bar follow suite)
Thanks,
Nick
0 comentarios
Respuesta aceptada
Steven Lord
el 8 de Mayo de 2023
See the "Remove Default Values" or "Set Properties to Factory-Defined Values" sections on this documentation page.
3 comentarios
Steven Lord
el 8 de Mayo de 2023
The simplest way to reset the figure properties is to restart MATLAB, especially if you've changed a lot of property default values (which it sounds like you have.)
If that too isn't an option, you should probably look for default axes properties set on either groot or the current figure.
get(groot, 'defaultaxes')
get(gcf, 'defaultaxes')
Más respuestas (0)
Ver también
Categorías
Más información sobre Interactive Control and Callbacks en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!