Skip to content

BUG: boxplot does not set limits of axis #5517

Closed
@aseyboldt

Description

@aseyboldt

DataFrame.boxplot fails to properly set the limits of the y-axis is this example:

df = pd.DataFrame({'X': [1, 0, 1, 0],
                   'Y': [1, 0, 1, 0],
                   'Z': [1, 0, 1, 0],
                   #'M': [1, 0, 1, 0],
                   'B': list("XXYY")}, 
                  index=list("UUVV"))

print df
"""
   B  X  Y  Z
U  X  1  1  1
U  X  0  0  0
V  Y  1  1  1
V  Y  0  0  0
"""

df.boxplot(by='B')

I would expect the y-axis to go from 0 to 1, not -0.06 to 0.06.
If I uncomment the M it works.

I use pandas 0.12.0 and matplotlib 1.3.1

Uploading boxplot.png . . .

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions