Skip to content

plot.bar misalignment when width=1 #12979

Closed
@kdebrab

Description

@kdebrab

Two minor issues with the width optional argument of plot.bar() in Pandas 0.18.0:

  1. Using width=1 (integer) causes misalignment of the x-axis
import pandas as pd
import numpy as np
df = pd.DataFrame(np.random.random((6, 5)) * 10, index=list('abcdef'), columns=list('ABCDE'))
df.plot.bar(stacked=True, width=1)

figure_1

Compare this with the correct behaviour when defining width as a float:

df.plot.bar(stacked=True, width=1.)

figure_2

  1. Using width=None causes a TypeError, where I would expect the default behaviour.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions