Giter Club home page Giter Club logo

Comments (6)

M-funk avatar M-funk commented on May 17, 2024

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()
ax = fig.add_subplot(111)
ax.errorbar([1.,2.,3.],[1.,1.,1.],yerr = [0.1,3.,0.4])
ax.set_yscale('log')
fig.savefig('test.png')

something like this outputs:
http://i.imgur.com/LOIi7.png

I think the problem lies in the fact that numpy computes log(1), in any base, equal to 0

from matplotlib.

pelson avatar pelson commented on May 17, 2024

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:

ax.errorbar([10, 11, 12], [8, 9, 10], yerr=[0.5, 0.7, 0.9])

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))?

from matplotlib.

neggert avatar neggert commented on May 17, 2024

This can be worked around by doing

ax.set_yscale('log', nonposy="clip")

Maybe this should be the default for set_yscale? This seems to cause quite a few problems.

from matplotlib.

kreczko avatar kreczko commented on May 17, 2024

@neggert : Nice workaround.
Wish I had seen it before I wasted 1 hour to try and fix it ;)

From a beginners standpoint I would definitely vote for making it the default (unless there are obvious reasons not to do so).

from matplotlib.

mdboom avatar mdboom commented on May 17, 2024

👍 on making the default clip, with the appropriate API change warning.

from matplotlib.

SebastianoF avatar SebastianoF commented on May 17, 2024

Uhm... No, the errorbar should not be asymmetric when passing in log scale.
Please consider
http://faculty.washington.edu/stuve/uwess/log_error.pdf
If I understood correctly the documentation, I would consider nonposx="mask" as the best option of the default behavour.

from matplotlib.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.