How to highlight y=0 grid line in a 2D plot
24 views (last 30 days)
Show older comments
Bhaskar Ravishankar
on 12 Mar 2020
Commented: Bhaskar Ravishankar
on 13 Mar 2020
Hello,
I have several plots with both positive and negative Y values. I want to highlight the 0-crossing line (0-grid line) on the Y-Axis of these plots.
I searched the property inspector to change grid line properties but I did not find anything specific for this.
I have attached a sample of the graph I get. Please help. Thank you.
0 Comments
Accepted Answer
Walter Roberson
on 12 Mar 2020
You can use yline() from R2018b or later. For older releases you can use refline()
You might want to uistack() the line to below the other objects.
You will not find a property to highlight a particular grid line (other than in the sense that you could turn off the other grid lines, so by default the remaining one would be visible.)
More Answers (0)
See Also
Categories
Find more on Labels and Annotations in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!