How can i keep the fontsize on colorbar when saving as JPEG, TIFF etc....

I am producing graphs in Matlab to be converting as JPEG/TIFF for inclusion into documents. I use a font 30 on graphs. Everything saves as such except for the colorbar which return to a very small font 8/10. Does anyone knows the solution to this problem? Many thanks

 Respuesta aceptada

sH = surf(peaks);
cH = colorbar;
set(cH,'FontSize',30);

6 comentarios

Tried this but again as soon as i tried to save in a format different from .fig, the font on the colorbar returns to something very small....
José-Luis
José-Luis el 16 de En. de 2013
Editada: José-Luis el 16 de En. de 2013
fH = figure(1);
sH = surf(peaks);
cH = colorbar;
set(cH,'FontSize',30);
saveas(1,'test.jpeg');
This works in my computer. Does it work on yours?
Yes this works !!!! Thank you so much
José-Luis
José-Luis el 16 de En. de 2013
Editada: José-Luis el 16 de En. de 2013
My pleasure. Please accept an answer if it helped you.
Thank you for the solution Jose!
This also changes the size of the tick labels on the colorbar, but I only want the size of the colorbar label to stay big.

Iniciar sesión para comentar.

Más respuestas (2)

Same as José-Luis's answer except change:
set(cH,'FontSize',30)
To this:
set(cH.Label,'FontSize',30)
8 Years later...😎
Since I already set the font size in my code, what I did was saving the figure programatically with:
saveas(gcf, 'filename.extension')

Etiquetas

Preguntada:

el 16 de En. de 2013

Respondida:

el 1 de Ag. de 2021

Community Treasure Hunt

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

Start Hunting!

Translated by