-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Problem with errorbar in log scale #163
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
The error bar does plot, but for some reason, it doesn't show the vertical connecting bar. You'll see if you do this: fig = plt.figure() something like this outputs: I think the problem lies in the fact that numpy computes log(1), in any base, equal to 0 |
Confirming. Pretty sure this is related to the fact that you are trying to plot an error bar down to log(0). This works if your not trying log(0). For instance:
Looks fine. @M-funk: can you confirm what you are expecting to see? I can't see that there is an action on this issue (perhaps a warning might be suitable when you are at log(0))? |
This can be worked around by doing
Maybe this should be the default for |
@neggert : Nice workaround. From a beginners standpoint I would definitely vote for making it the default (unless there are obvious reasons not to do so). |
👍 on making the default |
Uhm... No, the errorbar should not be asymmetric when passing in log scale. |
Original report at SourceForge, opened Wed Sep 1 13:52:54 2010
When using log scale, if the error is larger than flux, the error bar does not plot at all:
import matplotlib as mpl
mpl.use('Agg')
import matplotlib.pyplot as plt
fig = plt.figure()
ax = fig.add_subplot(1, 1, 1)
ax.errorbar([1.],[1.],yerr=[2.])
ax.set_yscale('log')
fig.savefig('test.png')
However, I think it would make more correct to plot the line for the errorbar, and to make it go down to -infinity.
The text was updated successfully, but these errors were encountered: