Borrar filtros
Borrar filtros

different font sizes for y labels

5 visualizaciones (últimos 30 días)
Hamid
Hamid el 21 de Abr. de 2019
Respondida: Hamid el 21 de Abr. de 2019
Hello,
I want to have different font sizes for y-labels. for example in this simple plot, I want to have -2 and 2 in y-axis in font 16 and the rest in font 12:
x = -1:0.01:1;
y = 3*asin(x);
plot(x,y)
set(gca,'Ytick',[-4, -2, 0, 2, 4])

Respuesta aceptada

Walter Roberson
Walter Roberson el 21 de Abr. de 2019
set(gca, 'fontsize', 16) %the larger of the font sizes
set(gca, 'YTickLabels', {'\fontsize{12}{-4}', '-2', '\fontsize{12}{0}', '2', '\fontsize{12}{4}'})

Más respuestas (1)

Hamid
Hamid el 21 de Abr. de 2019
Thank you very much!

Categorías

Más información sobre Graphics Object Properties 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!

Translated by