Using the code below (and with the help of this really good page:
CodePudding user response:
You can use secondary_yaxis()
to set a second y-axis on the other side for the same plot. Also, as you indicated that you want to show the ticks at 0.5 distance, you can use set_yticks()
for that. Add these two lines just before the plt.show()
ax2 = ax.secondary_yaxis("right")
ax2.set_yticks(np.arange(0, max(df['Ach_Num']) .5, 0.5))
Updated plot (using random data)