Post-formatting of figures
2 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Hello all,
Some time ago, I saved some figures. Now that I want to use them, I am wondering if I can change the text size and color afterwards. It is not easy to read.
I found this, but I am not sure if it works on an already existing figure. Does anyone have any ideas? Due to its size I cannot attach the .fig file here, so I added a screenshot.
Many thanks!
0 comentarios
Respuesta aceptada
Voss
el 29 de Mzo. de 2024
You can open the saved figure with the openfig function.
f = openfig('figure1.fig');
You can modify any property of the figure or anything in the figure. But you have to know how to find the object(s) you want to modify. findall can be used for that.
For example, modify the colors and sizes of the x/yticklabels of the axes:
f = openfig('figure1.fig');
ax = findall(f,'Type','axes')
ax.XColor = [0 1 1]; % cyan
ax.YColor = [1 0 1]; % magenta
ax.FontSize = 16; % font size of all tick labels
The axes x/ylabels and titles are text objects, so you can use findall to find all text objects in the figure, then modify their properties:
t = findall(f,'Type','text')
t(1).Color = [1 0 0]; % make title red
t(2).Color = [0 1 0]; % make xlabel green
t(3).Color = [0 0 1]; % make ylabel blue
set(t,'FontSize',16) % make all 3 into 16-point size
2 comentarios
Más respuestas (0)
Ver también
Categorías
Más información sobre Annotations 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!