Skip to content

unable to set xticks within bar() plotting function #14119

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
evfro opened this issue Aug 29, 2016 · 2 comments · Fixed by #28172
Closed

unable to set xticks within bar() plotting function #14119

evfro opened this issue Aug 29, 2016 · 2 comments · Fixed by #28172
Labels
Milestone

Comments

@evfro
Copy link

evfro commented Aug 29, 2016

Code Sample, a copy-pastable example if possible

In the code below:

pd.Series(range(10), index=range(10)).plot.bar(xticks=range(0, 11, 2))

xticks argument has no effect. However, there's no such problem in line() plot.

Expected Output

Output plot is expected to have xticks defined by xticks argument, e.g. in the example above it should be set to [0, 2, 4, 6, 8, 10].

output of pd.show_versions()

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

pandas: 0.18.1
nose: None
pip: 8.1.2
setuptools: 23.0.0
Cython: None
numpy: 1.11.1
scipy: 0.17.1
statsmodels: None
xarray: 0.8.1
IPython: 5.0.0
sphinx: None
patsy: None
dateutil: 2.5.3
pytz: 2016.4
blosc: None
bottleneck: None
tables: None
numexpr: None
matplotlib: 1.5.1
openpyxl: None
xlrd: None
xlwt: None
xlsxwriter: None
lxml: None
bs4: None
html5lib: None
httplib2: None
apiclient: None
sqlalchemy: None
pymysql: None
psycopg2: None
jinja2: 2.8
boto: None
pandas_datareader: None

@TomAugspurger TomAugspurger added the Visualization plotting label Aug 29, 2016
@TomAugspurger
Copy link
Contributor

We'd need to decide what to do if len(series) isn't equal to len(xticks), I assume matplotlib will just throw and error, which is probably fine.

Mind stepping through tools/plotting.py to see what's going on?

@TomAugspurger TomAugspurger added this to the 0.20.0 milestone Aug 29, 2016
@evfro
Copy link
Author

evfro commented Aug 29, 2016

At first glance it doesn't look very straightforward. I'll look more closely a bit later.

@jreback jreback modified the milestones: 0.20.0, Next Major Release Mar 23, 2017
GiuPassarelli added a commit to GiuPassarelli/pandas that referenced this issue Aug 27, 2019
@TomAugspurger TomAugspurger modified the milestones: Contributions Welcome, 1.0 Aug 30, 2019
proost pushed a commit to proost/pandas that referenced this issue Dec 19, 2019
proost pushed a commit to proost/pandas that referenced this issue Dec 19, 2019
bongolegend pushed a commit to bongolegend/pandas that referenced this issue Jan 1, 2020
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.

3 participants