Clear Filters
Clear Filters

Plotting a vertical line using ezplot

6 views (last 30 days)
I have a graph and I would like to add a vertical line say x=1 to the graph. how might I do that? (Perhaps ezplot doesn't work for that?)
thank you!

Accepted Answer

Matt Fig
Matt Fig on 5 Sep 2012
Edited: Matt Fig on 5 Sep 2012
This will put a vertical line in the middle of the axes. Adjust as needed.
LIM = get(gca,{'xlim','ylim'});
L = line(mean(LIM{1})*[1 1],LIM{2});

More Answers (0)

Categories

Find more on 2-D and 3-D Plots in Help Center and File Exchange

Tags

Products

Community Treasure Hunt

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

Start Hunting!