Usually I always get the answer to my questions here, so here's a new one. I am working on some data analysis when I import various csv files, set the index, and then try to build it.
Here is the code. Keep in mind that I use obdobjeand -obdobjebecause the index comes from different files, but the format is the same:
fig, axes = plt.subplots(nrows=2, ncols=1)
df1_D1[obdobje:].plot(ax=axes[0], linewidth=2, color='b', linestyle='solid')
df2_D1[obdobje:].plot(ax=axes[0], linewidth=2, color='b',linestyle='dashed')
df_index[:-obdobje].plot(ax=axes[1])
plt.show()
Here are the data that is imported into the dataframe:
Adj Close
Date
2015-12-01 73912.6016
2015-11-02 75638.3984
2015-10-01 79409.0000
2015-09-01 74205.5000
2015-08-03 75210.3984
Location CLI
TIME
1957-12-01 GBR 98.06755
1958-01-01 GBR 98.09290
1958-02-01 GBR 98.16694
1958-03-01 GBR 98.27734
1958-04-01 GBR 98.40984
And the result that I get:

So the problem is that the X axes are not separated. They are close, but not shared. Any suggestions how to solve this? I tried with sharex=True, but Python crashed every time.
Thanks in advance guys.
Best regards, David
source
share