Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Errorbar: do not ignore inf but plot errorbar bigger than current frame size #7876

Closed
@FrederikLauber

Description

@FrederikLauber

Hi,

if you run this code:

import numpy
import matplotlib.pyplot as plt
fig1, ax1 = plt.subplots(figsize=(15, 9))
a = numpy.arange(10)
b = a**2
c = numpy.array([1.0] * 10)
c[2] = numpy.nan
c[8] = numpy.inf
ax1.errorbar(a,b,c)
fig1.show()

you will get this figure:

figure_1

As you can see, both the error bar at 3 and 9 are missing. 3 has an error of "nan", so leaving out the error bar to indicate this is fine in my eyes. 9 has "inf" and also has no error bar. I think it would be better, if this error bar would be bigger then the frame of the figure.
Hence you would see that the error is at this point is bigger then the current y limits and not confuse this with a non existent error. Also in plots with vastly different error bars, an infinite error can no longer be confused with an error of size 0.

Thanks in advance,

Metadata

Metadata

Assignees

No one assigned

    Labels

    API: changesDifficulty: Mediumhttps://matplotlib.org/devdocs/devel/contribute.html#good-first-issues

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions