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

[ENH]: errorbar(x, y, yrange=...) as an alternative to errorbar(x, y, yerr=...) · Issue #26220 · matplotlib/matplotlib · GitHub

Repository navigation

[ENH]: errorbar(x, y, yrange=...) as an alternative to errorbar(x, y, yerr=...) #26220

Description

Problem

Inspired from #26187:

It is sometimes easier to pass the explicit error range rather than +/- values from a given point.

Proposed solution

The suggestion is to support a yrange parameter so that one can do either:

errorbar(x, y, yerr=...)
errorbar(x, y, yrange=...)

Passing both parameters should result in an error.

Having mutually exclusive yerr, yrange parameters is usually a code smell. However here, it may actually be a viable option. (Practiality beats purity).

Is this really necessary? The user could just calculate yerr from their range values.

I think the shortest way to calculate this would be:

ymin = yrange[:,0]
ymax = yrange[:,1]
yerr = np.array([y - ymin, ymax - y]).T

This is quite tedious to get right (in particular the sign for the neg. yerr). Additionally, this still does not cover unit handling. So I assume, the yrange parameter would be a substantial simplification.

Activity

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

    New featurekeepItems to be ignored by the “Stale” Github Action

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions


      Back | FazBrowse Home | New Git URL