I am trying to create a scatter sub plot with two different variable for the y-axis. The data is imported from an excel sheet using pandas. The x-axis is time elapsed while one of the y-axes is temperature and the other is pressure. Here is the code that I used:
fig,cx = plt.subplots(nrows = 1, ncols = 4, figsize = (15,5))
cx[0].scatter(Helium1['ΔT(s)'], Helium1['Pref (Bar)'], marker = 'x')
cx[0].set_xlabel('ΔT(s)')
cx[0].set_ylabel('Pref (Bar)')
cx[0].set_title('Uncorrected Pressure')
cx[0].tick_params(axis='y', labelcolor='black')
cx1 = cx.twinx()
cx1[0].scatter(Helium1['ΔT(s)'], Helium1['Temp(°C)'], marker = 'x')
cx1[0].set_xlabel('ΔT(s)')
cx1[0].set_ylabel('Pref (Bar)')
cx1[0].set_title('Uncorrected Pressure')
cx1[0].tick_params(axis='y', labelcolor='black')
cx[1].scatter(Helium1['ΔT(s)'],Helium1['Pref,t (Bar)'], marker = 'v', color = 'orange')
cx[1].set_xlabel('ΔT(s)')
cx[1].set_ylabel('Pref,t (Bar)')
cx[1].set_title('Temperature corrected Pressure')
cx[1].tick_params(axis='y', labelcolor='black')
cx[2].scatter(Helium1['ΔT(s)'],Helium1['Pref,l (Bar)'], marker = 'v', color = 'Yellow')
cx[2].set_xlabel('ΔT(s)')
cx[2].set_ylabel('Pref,l (Bar)')
cx[2].set_title('Temperature corrected Pressure')
cx[2].tick_params(axis='y', labelcolor='black')
cx[2].scatter(Helium1['ΔT(s)'],Helium1['Pref,t (Bar)'], marker = 'v', color = 'Orange')
cx[2].set_xlabel('ΔT(s)')
cx[2].set_ylabel('Pref,t (Bar)')
cx[2].set_title('Leak Correction')
cx[2].tick_params(axis='y', labelcolor='black')
cx[3].scatter(Helium1['ΔT(s)'],Helium1['Pref,l (Bar)'], marker = 'v', color = 'Yellow')
cx[3].set_xlabel('ΔT(s)')
cx[3].set_ylabel('Pref,l (Bar)')
cx[3].set_title('Leak Corrected Pressure')
cx[3].tick_params(axis='y', labelcolor='black')
However when I run the code I get the error message: 'numpy.ndarray' object has no attribute 'twinx'
I would appreciate any help with this.