different font sizes for y labels

조회 수: 4 (최근 30일)
Hamid
Hamid 2019년 4월 21일
답변: Hamid 2019년 4월 21일
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])

채택된 답변

Walter Roberson
Walter Roberson 2019년 4월 21일
set(gca, 'fontsize', 16) %the larger of the font sizes
set(gca, 'YTickLabels', {'\fontsize{12}{-4}', '-2', '\fontsize{12}{0}', '2', '\fontsize{12}{4}'})

추가 답변 (1개)

Hamid
Hamid 2019년 4월 21일
Thank you very much!

카테고리

Help CenterFile Exchange에서 Graphics Object Properties에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by