I want to add a x-axis line at 0 to a Matlab figure so that I can compare my data to see if it is positive or negative when saving the figures to a jpg. What is the best way to do this? I know you can use line()
but it just seems cumbersome because you need to specify the x and the y ranges. Is there an easier way?
I don't believe there is a built-in way that is more convenient. I use hline()
and vline()
from FileExchange, which work like a charm: