MATLAB Answers

Changing size label in xline

조회 수: 32(최근 30일)
Miquel Vega
Miquel Vega 2021년 5월 10일
댓글: Star Strider 2021년 5월 10일
Hi,
I have a plot where I have added some vertical lines with the xline function. I also have some labels on this vertical lines. However, I would like to display the labels in a bigger size, but I don't know how to do it. I have checked the documentation on xline and can't find any option regarding the size of the label.
I would appreciate if you could indicate me how to do it.
Thanks for your help :)

채택된 답변

Star Strider
Star Strider 2021년 5월 10일
Try this —
x = linspace(0,6,100);
y = exp(x);
plot(x,y)
hxl = xline(4.5,'-',{'Acceptable','Limit'});
x = linspace(0,6,100);
y = exp(x);
plot(x,y)
hxl = xline(4.5,'-',{'Acceptable','Limit'});
hxl.FontSize = 25;
Example copied from the xline documentation.
  댓글 수: 2
Star Strider
Star Strider 2021년 5월 10일
As always, my pleasure!

댓글을 달려면 로그인하십시오.

추가 답변(0개)

Community Treasure Hunt

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

Start Hunting!

Translated by