如何在图形上添加X轴线? (matlab) [英] How to add a x-axis line to a figure? (matlab)
问题描述
我想在Matlab图形上添加一条在0处的x轴线,以便在将图形保存为jpg时可以比较我的数据以查看它是正数还是负数.做这个的最好方式是什么?我知道您可以使用line()
,但这似乎很麻烦,因为您需要指定x和y范围.有没有更简单的方法?
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?
推荐答案
我不相信有一种内置的方式更方便.我使用FileExchange中的hline()
和vline()
,它们的工作方式像一个超级按钮:
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:
http://www.mathworks.com/matlabcentral/fileexchange/1039
这篇关于如何在图形上添加X轴线? (matlab)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!