FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

[Bug]: Errorbars separated from markers with negative errors · Issue #21101 · matplotlib/matplotlib · GitHub

Repository navigation

[Bug]: Errorbars separated from markers with negative errors #21101

Description

Bug summary

If unique upper and lower errors are specified, and one of them is negative, then the errorbar will appear separate from the marker. It looks like this was mentioned ages ago in #2717 but I could not find a follow up to that issue.

Code for reproduction

import matplotlib.pyplot as plt

# 1
plt.errorbar([0], [0], yerr=[[-0.5], [1]], marker="o")

# 2
plt.errorbar([0], [0], xerr=[[-0.5], [1]], marker="o")

# 3
plt.errorbar([0], [0], xerr=[[-0.5], [1]], yerr=[[-0.5], [1]], marker="o")

Actual outcome

1

2

3

Expected outcome

I understand the documentation states that the error inputs should be positive values, but I would expect some error like ValueError when there is a negative value provided, rather than it trying to make the plot. I would prefer an error being thrown and the plot not being made.

Operating system

CentOS Linux release 7.9.2009 (Core)

Matplotlib Version

3.4.3

Matplotlib Backend

module://matplotlib_inline.backend_inline

Python version

3.9.6

Jupyter version

3.1.9

Other libraries

No response

Installation

conda

Conda channel

No response

Activity

  1. tacaswell commented on Sep 17, 2021

    Member

    So I see why it is doing this ('we draw the error bar from (val - lower_error, val + upper_error)), but I agree, if we document that negative errors should not work, we should do the validation and raise ValueError

    The tasks here are:

    • add validator to at at least the errorbar method
    • investigate how much work it would be to add validation to updating the errorbars after-the-fact (I think in that case the user has to do the offsets them selves so there may be nothing we can do)
    • add a test
  2. added
    🌱 Good first issueOpen a pull request against these issues if there are no active ones!
    on Sep 17, 2021
  3. added this to the v3.6.0 milestone on Sep 17, 2021
  4. lucafs commented on Sep 23, 2021

    I will try to work on this near future.

  5. added a commit that references this issue on Oct 5, 2021
    e37902e
  6. added a commit that references this issue on Oct 12, 2021
    8a35be5
  7. added a commit that references this issue on Oct 20, 2021
    8798ab0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    🌱 Good first issueOpen a pull request against these issues if there are no active ones!

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions


      Back | FazBrowse Home | New Git URL