You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fig, axes=subplots(3,3, sharex=True, sharey=True)
forchinrange(1,7):
axis=axes.flatten()[ch-1]
cols=somecodetomapchtocol_namesdf[cols].plot(ax=axis)
# do the same for 3 more channels with different IDsforchinrange(1,4):
axis=axes.flatten()[ch-1+6]
cols=somecodetomapchtocol_names, slightlydifferenttoabovedf[cols].plot(ax=axis)
I have 2 problems with the result:
sharex does not seem to work for time axes
The last major x-ticklabel of the last row of axes is 10:00, while for the first 2 rows it is 9:00. I confirmed that all columns have data in the last row (index = 2011-04-02 10:00:00.718000) and not NaN which would have been excluded in the plot, potentially.
Possibly the 2 probs are related?
The text was updated successfully, but these errors were encountered:
Not 100% sure, but this seems to be the same issue as #7801. Based on my understanding:
sharex works correctly.
ticklabels looks different because major ticklabels are displayed only on bottom axes.
Unfortunately #7801 CANNOT solve this because #7801 will hide minor ticklabels in pandas.tools.plotting._subplots, and will not affect existing axes created by plt.subplots.
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
fig, axes = plt.subplots(3, 3, sharex=True)
plt.subplots_adjust(left=0.05, right=0.95, hspace=0.3, wspace=0.3)
df = pd.DataFrame(np.random.randn(10, 9), index=pd.date_range(start='2014-07-01', freq='M', periods=10))
for i, ax in enumerate(axes.ravel()):
df[i].plot(ax=ax, fontsize=5)
Workaround is use layout kw to create (3, 3) layout using pandas.tools.plotting._subplots (possible after #7736).
I don't understand what you are saying, because the idea of sharex is that only the bottom line of graphs shows the x-axis' labels, so why would you state above that sharex is working correctly?
I am creating the attached plot like this:
I have 2 problems with the result:
Possibly the 2 probs are related?
The text was updated successfully, but these errors were encountered: