How to plot a line on a log plot

I am trying to plot a line on a log plot. I am using the same method as if I was to draw a line on a standard plot ie. hold on, plot(x,y) etc. Instead of plotting the line it just plots 2 dots. Is there any way to get around this?

2 个评论

Can you just post your code, or ideally a very distilled example that shows what you mean?
>> semilogy(x,final_matrix(:,2))
>> ylabel('Kurtosis')
>> hold on
>> plot([141/4 141/4],[0 4000],'--k')
The second plot function just plots two points rather than a line
Thanks

请先登录,再进行评论。

 采纳的回答

the cyclist
the cyclist 2013-9-3
编辑:the cyclist 2013-9-3

0 个投票

Well, I can't replicate your plot, because I don't have access to your variable final_matrix, but I am suspicious of your plot() command having a zero in it. log(0) is -Inf, so I think you may have a difficult time plotting that.

更多回答(0 个)

类别

在 帮助中心 和 File Exchange 中查找有关 2-D and 3-D Plots 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by