How to a create a label at the bottom of a vertical line?

92 次查看(过去 30 天)
I am plotting a vertical line using xline, and I'd like to label the plot at the bottom of the line instead of the top. The example at https://www.mathworks.com/help/matlab/ref/xline.html is a good example of what I am getting now:
x = linspace(0,6,100);
y = exp(x);
plot(x,y)
xline(4.5,'-',{'Acceptable','Limit'});
How can the label be moved to the bottom of the line (near the x-axis)?

采纳的回答

Alan Stevens
Alan Stevens 2024-3-15
Like this?
x = linspace(0,6,100);
y = exp(x);
plot(x,y)
xline(4.5,'-',{'Acceptable','Limit'}, 'LabelVerticalAlignment', 'bottom');
  1 个评论
Allen Hammack
Allen Hammack 2024-3-15
Yes, that's exactly what I needed! Thank you!
(If only I had read the documentation a bit more closely.)

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Matrix Indexing 的更多信息

产品


版本

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by