import numpy as np
import pandas as pan
import matplotlib.pyplot as plt
import matplotlib.dates as mdates
import csv
import datetime
timestamp1 = []
for t in ts_temp1:
timestamp1.append(mdates.datestr2num(t))
formatter = mdates.DateFormatter('%Y-%b-%d')
plt.plot_date(timestamp1,xgtemp1,'r.',label='X GALVO 1',lw=2)
plt.plot_date(timestamp1,ygtemp1,'b.',label='Y GALVO 1',lw=2)
ax = plt.gcf().axes[0]
ax.xaxis.set_major_formatter(formatter)
plt.gcf().autofmt_xdate(rotation=25)
plt.ylabel('Galvo Temperatures (°C)')
plt.grid()
plt.legend(loc='upper right')
plt.show()
I'm trying to create a subplot with 3 rows and 1 column of plots. I have 3 blocks of "plotting" code identical to the one above. The goal is to have all the plots within the subplot to share the same x-axis. I'm unsure how to approach this subplot as my many previous attempts haven't worked at all.
Sidenote: I've tried plotting with other methods but this is the only one that correctly plots the timestamps.