Skip to content

No labels on X-axis on charts with secondary_y=True #14102

Closed
@dmage

Description

@dmage

Code Sample, a copy-pastable example if possible

#!/usr/bin/env python3
import matplotlib.pyplot as plt
import pandas as pd

# some data
s1 = pd.Series(data=[5,7,6,8,7], index=[1,2,3,4,5])
s2 = pd.Series(data=[6,4,5,3,4], index=[1,2,3,4,5])

ax = plt.subplot(2, 1, 1)
s1.plot(ax=ax)
s2.plot(ax=ax, secondary_y=True)

assert len(ax.xaxis.get_minor_ticks()) == 0

ax2 = plt.subplot(2, 1, 2)
#s1.plot(ax=ax2)  # uncomment me

assert len(ax.xaxis.get_minor_ticks()) == 0

plt.show()

Expected Output

Labels on x-axis (no minor ticks).
Plotting on ax2 not affects ax.

output of pd.show_versions()

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

pandas: 0.18.1
nose: None
pip: 8.1.2
setuptools: 23.1.0
Cython: None
numpy: 1.11.1
scipy: None
statsmodels: None
xarray: None
IPython: 5.0.0
sphinx: None
patsy: None
dateutil: 2.5.3
pytz: 2016.6.1
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

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions