How to plot a dotted black line (without using yline function)?
Afficher commentaires plus anciens
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
darova
le 29 Sep 2019
What about usign plot()? Is it possible?
Rik
le 29 Sep 2019
And maybe also add a listener to make sure the line is extended when the x range changes.
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
le 29 Sep 2019
or,
matlab.graphics.chart.decoration.ConstantLine('InterceptAxis', 'y', 'Value', 0.5,'Parent',gca, 'LineStyle','--','Color', 'k')
Réponses (0)
Catégories
En savoir plus sur 2-D and 3-D Plots dans Centre d'aide et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!