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

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 Commenti

What about usign plot()? Is it possible?
And maybe also add a listener to make sure the line is extended when the x range changes.
Darova's ide:
yln = plot([0,max(xlim())],[0,0], 'k--');
I like Rik's idea, too. Here's some background info
or,
matlab.graphics.chart.decoration.ConstantLine('InterceptAxis', 'y', 'Value', 0.5,'Parent',gca, 'LineStyle','--','Color', 'k')

Accedi per commentare.

Risposte (0)

Categorie

Scopri di più su MATLAB Coder in Centro assistenza e File Exchange

Prodotti

Richiesto:

il 29 Set 2019

Commentato:

il 29 Set 2019

Community Treasure Hunt

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

Start Hunting!

Translated by