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

43 vues (au cours des 30 derniers jours)
Anne Nguyen
Anne Nguyen le 29 Sep 2019
Commenté : Adam Danz le 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 commentaires
Adam Danz
Adam Danz le 29 Sep 2019
Darova's ide:
yln = plot([0,max(xlim())],[0,0], 'k--');
I like Rik's idea, too. Here's some background info
Adam Danz
Adam Danz le 29 Sep 2019
or,'InterceptAxis', 'y', 'Value', 0.5,'Parent',gca, 'LineStyle','--','Color', 'k')

Connectez-vous pour commenter.

Réponses (0)


En savoir plus sur Lighting, Transparency, and Shading dans Help Center et File Exchange


Community Treasure Hunt

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

Start Hunting!

Translated by