Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Plotting: .hist() and .plot.hist() #21048

Closed
mangecoeur opened this issue May 15, 2018 · 1 comment
Closed

Plotting: .hist() and .plot.hist() #21048

mangecoeur opened this issue May 15, 2018 · 1 comment
Labels
Duplicate Report Duplicate issue or pull request

Comments

@mangecoeur
Copy link
Contributor

mangecoeur commented May 15, 2018

Code Sample, a copy-pastable example if possible

cols = ['heat_total', 'area_density', 'mean_n_floors',
       'n_buildings', 'area_demand_density_grid', 'floor_demand_density']

plt.figure()
df[cols].plot.hist(
    bins=20,
    alpha=0.5
)

plt.figure()
df[cols].hist(
    bins=20,
    alpha=0.5
)

Problem description

df.hist() and df.plot.hist() give different plots: .hist() plots a grid of figures while .plot.hist() plots overlapping distributions.

Result of df.hist()

hist

Result df.plot.hist()

plothist

Expected Output

.hist() and .plot.hist() should give exactly the same results

Output of pd.show_versions()

INSTALLED VERSIONS

commit: None
python: 3.6.3.final.0
python-bits: 64
OS: Windows
OS-release: 10
machine: AMD64
processor: Intel64 Family 6 Model 94 Stepping 3, GenuineIntel
byteorder: little
LC_ALL: None
LANG: None
LOCALE: None.None

pandas: 0.22.0
pytest: 3.2.1
pip: 9.0.1
setuptools: 36.5.0.post20170921
Cython: 0.26.1
numpy: 1.14.2
scipy: 0.19.1
pyarrow: None
xarray: 0.10.0
IPython: 6.2.1
sphinx: 1.6.3
patsy: 0.4.1
dateutil: 2.6.1
pytz: 2017.2
blosc: None
bottleneck: 1.2.1
tables: 3.4.2
numexpr: 2.6.4
feather: None
matplotlib: 2.2.2
openpyxl: 2.4.9
xlrd: 1.1.0
xlwt: 1.3.0
xlsxwriter: 1.0.2
lxml: 4.1.0
bs4: 4.6.0
html5lib: 0.999999999
sqlalchemy: 1.1.13
pymysql: None
psycopg2: 2.7.4 (dt dec pq3 ext lo64)
jinja2: 2.9.6
s3fs: None
fastparquet: None
pandas_gbq: None
pandas_datareader: None

@TomAugspurger
Copy link
Contributor

Closing in favor of #11053

@TomAugspurger TomAugspurger added the Duplicate Report Duplicate issue or pull request label May 15, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Duplicate Report Duplicate issue or pull request
Projects
None yet
Development

No branches or pull requests

2 participants