I found a solution, which isn't exactly what I was looking for but fulfills the purpose. I modified the solution posted of this link:
fig=plt.figure()
fig,(ax,ax2,ax3) = plt.subplots(1,3,sharey=True)
fig.subplots_adjust(wspace=0.05)
fig.set_size_inches(20, 3, forward=True)
ax.plot(healthyde['timestamp'],healthyde['value'],label='healthy',color='g')
ax2.plot(healthynde['timestamp'],healthynde['value'],label='detection',color='y')
ax3.plot(healthylde['timestamp'],healthylde['value'],label='fault',color='r')
ax.set_xlim(healthyde['timestamp'].iloc[0], healthyde['timestamp'].iloc[-1] )
ax2.set_xlim(healthynde['timestamp'].iloc[0], healthynde['timestamp'].iloc[-1] )
ax3.set_xlim(healthylde['timestamp'].iloc[0], healthylde['timestamp'].iloc[-1] )
labels = ax.get_xticklabels()
for label in labels:
label.set_rotation(30)
labels = ax2.get_xticklabels()
for label in labels:
label.set_rotation(30)
labels = ax3.get_xticklabels()
for label in labels:
label.set_rotation(30)
ax.legend()
ax2.legend()
ax3.legend()
plt.show()
Output:
