hello stackoverflow community
I'm a newcomer and have the following code:
fig, axs = plt.subplots(2, 2, figsize=(20,20), dpi=(100))
axs[0,0].set_title('2017, Zeitreihe, Zähler: ' + Zaehler)
sns.lineplot(data= data_heatmap_2017, x='date_time', y= 'Leistung:', linewidth=0.1, ax=axs[0,0])
sns.lineplot(data= data_heatmap_2017, x='date_time', y= 'tre200h0_2017', linewidth=0.1, color='orange', ax=axs[0,0].twinx())
axs[0,0].xaxis.set_major_locator(ticker.MultipleLocator(1000))
axs[0,0].tick_params(axis='x', labelrotation=90)
axs[0,0].set_ylabel('Leistung [kW]')
axs[0,0].set_ylim([min_Power, max_Power])
axs[0,0].twinx().set_ylabel('Aussentemperatur [°C]')
axs[0,0].twinx().set_ylim([-15, 35])
axs[0,1].set_title('2018, Zeitreihe, Zähler: ' + Zaehler)
sns.lineplot(data= data_heatmap_2018, x='date_time', y= 'Leistung:', linewidth=0.1, ax=axs[0,1])
sns.lineplot(data= data_heatmap_2018, x='date_time', y= 'tre200h0_2018', linewidth=0.1, color='orange', ax=axs[0,1].twinx())
axs[0,1].xaxis.set_major_locator(ticker.MultipleLocator(1000))
axs[0,1].tick_params(axis='x', labelrotation=90)
axs[0,1].set_ylabel('Leistung [kW]')
axs[0,1].set_ylim([min_Power, max_Power])
axs[0,1].twinx().set_ylabel('Aussentemperatur [°C]')
axs[0,1].twinx().set_ylim([-15, 35])
# a lot more plots will come here
As you can see in the picture the secondary y-axis give me a hard time: The secondary y-axis of each subplot should be labled with "Aussentemperatur". Furthermore for better comparision the scale of the secondary y-axis should have the same range (-15 up to 35). I used .twinx().set_ylabel('Aussentemperatur [°C]') for labeling and .twinx().set_ylim([-15, 35]) for scaling. twinx(). seems not to work appropriate, the output is just a somehow overlay... Any idea how to solves this and get a clear axis from -15 to 35?