Home > front end >  How to add a value of a point on y axis in a PLOT in MATLAB?
How to add a value of a point on y axis in a PLOT in MATLAB?

Time:07-23

For example many points and I want to display them in a Plot. I want to appear the value of point on y axis, for example: the point ( 4, 2.5), I want to display the 2.5 on the Y axis and a small line between the point and its Y value enter image description here

PS: I want to appear the value on the left of y-axis

CodePudding user response:

Adding ticks to an axis can be done with plot

Similarly you could use xline to add the orthogonal label

xline( x, 'r-', num2str(x), 'LabelOrientation', 'horiz' );

plot 2

yline and xline were introduced in R2018b

  • Related