MATLAB Answers

How to plot a dotted black line (without using yline function)?

3 views (last 30 days)
Anne Nguyen
Anne Nguyen on 29 Sep 2019
Commented: Adam Danz on 29 Sep 2019
How do I plot a horizontal dotted black line going from 0 to the maximum value of x? The height of the line should be 0. I cannot use the yline function. Thank you!

  4 Comments

Show 1 older comment
Rik
Rik on 29 Sep 2019
And maybe also add a listener to make sure the line is extended when the x range changes.
Adam Danz
Adam Danz on 29 Sep 2019
or,
matlab.graphics.chart.decoration.ConstantLine('InterceptAxis', 'y', 'Value', 0.5,'Parent',gca, 'LineStyle','--','Color', 'k')

Sign in to comment.

Answers (0)

Sign in to answer this question.

Products