I need to suppress the Y axis values on right hand side which comes when you use two different Y axis labels with common X axis I want to remove the Y axis values which come on the right side of the axis :
eg:
import numpy as np
import matplotlib.pyplot as plt
list1=[1,2,3,4,5,6,7]
list2=[2,4,6,8,10,12,14]
list3=[2,4,6,8,10,12,14]
fig, ax1 = plt.subplots(2)
ax2 = ax1[0].twinx() # ax2 and ax1 will have common x axis and different y axis
ax1[0].plot(list1, list2, label="sin", color='r')
ax2.plot(list1, list3, label="sinh", color='b')
When I add yaxt="n" to ax2.plot line above it gives me an error:AttributeError: 'Line2D' object has no property 'yaxt'
Any pointers would be helpful