How can I add errorbars to a log-log plot?

10 次查看(过去 30 天)
I have tried the function errorbar but I could not plot at the log scale. This function work correctly but not in my case. The result I get is "Warning: Negative data ignored" and the resulting graph is attached below. The error bars should also decrease as x increases, something that is not happening. Can somebody help please? Either with a different function or the same one. Thank you in advance!

回答(1 个)

dpb
dpb 2018-8-6
Well, what is the log() of a negative value supposed to be?
You didn't show the values so we can't tell but clearly value-err is <0 for at least one point and that just can't be represented on a log axis. That's not the fault of the errorbar function and nothing can fix it other than changing the data.
As for visual appearance clearly the last two that are both positive are decreasing; they probably are numerically doing that for the others as well but error>value so value-error<0 as noted for the others.
Fix that and your problems will go away...

类别

Help CenterFile Exchange 中查找有关 Errorbars 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by