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

Plot label None in line plot #8905

Closed
micramm opened this issue Nov 27, 2014 · 4 comments
Closed

Plot label None in line plot #8905

micramm opened this issue Nov 27, 2014 · 4 comments
Labels
Milestone

Comments

@micramm
Copy link

micramm commented Nov 27, 2014

The plot label appears when plotting a dataframe as a scatter plot but not as a line plot. Is this expected?

df = pd.DataFrame(np.random.rand(2, 4), columns=['a', 'b', 'c', 'd'])
ax = df.plot(kind = 'scatter', x='a', y='b',color='DarkBlue', label='Label')
ax = df.plot(kind = 'line', x='a', y='b',color='DarkBlue', label='Label')

image
image

INSTALLED VERSIONS
------------------
commit: None
python: 2.7.8.final.0
python-bits: 64
OS: Darwin
OS-release: 14.0.0
machine: x86_64
processor: i386
byteorder: little
LC_ALL: None
LANG: en_US.UTF-8

pandas: 0.15.1
nose: 1.3.1
Cython: 0.21.1
numpy: 1.9.1
scipy: 0.14.0
statsmodels: None
IPython: 2.3.1
sphinx: 1.2.3
patsy: None
dateutil: 2.2
pytz: 2014.9
bottleneck: 0.8.0
tables: 3.1.1
numexpr: 2.4
matplotlib: 1.4.2
openpyxl: None
xlrd: None
xlwt: None
xlsxwriter: None
lxml: None
bs4: None
html5lib: None
httplib2: None
apiclient: None
rpy2: None
sqlalchemy: None
pymysql: None
psycopg2: None
@jorisvandenbossche
Copy link
Member

Yep, was also mentioned here: #8536 (comment). That was a PR to fix this issue (8491), but apparantly it was not fixed for all cases.

It seems this is specifically related to using x and y keywords with a line plot.

@micramm
Copy link
Author

micramm commented Nov 29, 2014

Right now the label keyboard behavior seems inconsistent. For a scatter plot it refers to the plot legend, but for the line plot it refers to the x axis label?

@jreback jreback added this to the 0.15.2 milestone Nov 30, 2014
dxe4 added a commit to dxe4/pandas that referenced this issue Dec 6, 2014
@jreback jreback modified the milestones: 0.16.0, 0.15.2 Dec 10, 2014
@petrushy
Copy link

petrushy commented Feb 5, 2015

in 0.15.2 release a quick fix seems to use data.plot(y=['col']) instead of data.plot(y='col')

@jreback jreback modified the milestones: 0.16.0, Next Major Release Mar 6, 2015
@jorisvandenbossche
Copy link
Member

This was also closed by #9574

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants