Skip to content

Missing spaces between lines and y-axis #27796

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

Closed
arthurire opened this issue Aug 7, 2019 · 1 comment
Closed

Missing spaces between lines and y-axis #27796

arthurire opened this issue Aug 7, 2019 · 1 comment

Comments

@arthurire
Copy link

arthurire commented Aug 7, 2019

Code Sample, a copy-pastable example if possible

import pandas as pd
import matplotlib.pyplot as plt
plt.plot([1,2],[2,4])
pd.DataFrame([2,4],index=[1,2]).plot()

image
image

Problem description

Plots generated by df.plot() and plt.plot() are different and I expected them exactly the same.

As you can see, all the spaces between y-axis and lines are missing when I use pd.DataFrame.plot().

When you have a large dataset and there's a rapid change at the end, the change might be covered by the border, makes the plot hard to read.

image

image

pandas version:0.25.0
matplotlib version:3.1.1

Latest version that works:
pandas:0.23.x
matplotlib 3.0.3

Expected Output

Two figures should look exactly the same.

Output of pd.show_versions()

INSTALLED VERSIONS

commit : None
python : 3.7.4.final.0
python-bits : 64
OS : Darwin
OS-release : 18.6.0
machine : x86_64
processor : i386
byteorder : little
LC_ALL : None
LANG : zh_CN.UTF-8
LOCALE : zh_CN.UTF-8

pandas : 0.25.0
numpy : 1.17.0
pytz : 2019.2
dateutil : 2.8.0
pip : 19.2.1
setuptools : 41.0.1
Cython : None
pytest : None
hypothesis : None
sphinx : None
blosc : None
feather : None
xlsxwriter : None
lxml.etree : None
html5lib : None
pymysql : None
psycopg2 : None
jinja2 : 2.10.1
IPython : 7.7.0
pandas_datareader: None
bs4 : None
bottleneck : None
fastparquet : None
gcsfs : None
lxml.etree : None
matplotlib : 3.1.1
numexpr : None
odfpy : None
openpyxl : None
pandas_gbq : None
pyarrow : None
pytables : None
s3fs : None
scipy : None
sqlalchemy : None
tables : None
xarray : None
xlrd : None
xlwt : None
xlsxwriter : None

@arthurire arthurire changed the title Missing spaces between lines and borders Missing spaces between lines and y-axis Aug 7, 2019
@TomAugspurger
Copy link
Contributor

Duplicate of #27686

@TomAugspurger TomAugspurger marked this as a duplicate of #27686 Aug 8, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants