Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
BUG in plotting timeseries data with twinx (different data representation on each ax) #14322
Comments
|
Pandas 0.13 is quite old, can you try with a more recent version? Also see if you can simplify your example a bit.
What do you mean by strange? |
cygenb0ck
commented
Sep 29, 2016
|
i just updated to pandas: 0.18.1 - sry for not trying with updated panda version sorry for my bad wording - by strange i meant, just, that is looks different |
|
@cygenb0ck Can you try to simplify the example? Eg try to make it reproducible by not having to read a csv file but just create the data with code. Also try to remove other things that are not essential to the problem as much as possible. |
jorisvandenbossche
added Visualization Needs Info
labels
Sep 30, 2016
cygenb0ck
changed the title from
After selecting rows between dates and plotting with matplotlib, plotted rows hide first axis to Plotting DataFrame on second axis hides data on first axis - was: Plotting a DataFrame on second axis hides data on first axis
Oct 1, 2016
cygenb0ck
commented
Oct 1, 2016
|
@jorisvandenbossche |
cygenb0ck
changed the title from
Plotting DataFrame on second axis hides data on first axis - was: Plotting a DataFrame on second axis hides data on first axis to Plotting DataFrame on second axis hides data on first axis - was: After selecting rows between dates and plotting with matplotlib, plotted rows hide first axis
Oct 1, 2016
jorisvandenbossche
removed the
Needs Info
label
Oct 1, 2016
|
@cygenb0ck Thanks a lot! That let me look at it, and it's a bit a gotcha with the dates. To start, it's not an issue with the
The reason it does not work with the example data you gave, is not because the plot is overwritten, but because the data on the first ax now fall outside the visible plot (if you zoom out enough, you will see both lines). This is because the dates are handled differently in the two cases. Workaround you can use for now is by also plotting on
|
jorisvandenbossche
added the
Bug
label
Oct 1, 2016
jorisvandenbossche
changed the title from
Plotting DataFrame on second axis hides data on first axis - was: After selecting rows between dates and plotting with matplotlib, plotted rows hide first axis to BUG in plotting timeseries data with twinx (different data representation on each ax)
Oct 1, 2016
|
Apparently, using
It's mentioned in the docs: http://pandas.pydata.org/pandas-docs/stable/visualization.html#suppressing-tick-resolution-adjustment (although for another reason, I am not that familiar with this keyword) |
jorisvandenbossche
referenced
this issue
Oct 1, 2016
Merged
BUG: mixed freq timeseries plotting with shared axes (GH13341) #14330
cygenb0ck
commented
Oct 3, 2016
|
@jorisvandenbossche |
cygenb0ck commentedSep 29, 2016
•
edited
Simplified the example.
During issue reporting i updated my pandas version from 0.13 to 0.18.1 - with version 0.13 i was able to add the whole DataFrame to my plot, only after i selected some rows between dates it produces the error. After the update the behaviour became worse - also adding the whole DataFrame to the plot now produces the error.
A small, complete example of the issue
Expected Output
Output of
pd.show_versions()commit: None
python: 3.4.3.final.0
python-bits: 64
OS: Linux
OS-release: 3.19.0-69-generic
machine: x86_64
processor: x86_64
byteorder: little
LC_ALL: None
LANG: en_US.UTF-8
pandas: 0.18.1


nose: 1.3.1
pip: 8.1.2
setuptools: 3.3
Cython: None
numpy: 1.11.1
scipy: 0.13.3
statsmodels: None
xarray: None
IPython: 1.2.1
sphinx: None
patsy: None
dateutil: 2.5.3
pytz: 2016.6.1
blosc: None
bottleneck: None
tables: 3.1.1
numexpr: 2.2.2
matplotlib: 1.5.2
openpyxl: None
xlrd: None
xlwt: None
xlsxwriter: None
lxml: None
bs4: 4.2.1
html5lib: 0.999
httplib2: None
apiclient: None
sqlalchemy: None
pymysql: None
psycopg2: None
jinja2: None
boto: None
pandas_datareader: None