I am trying to plot two-axis plots in matplotlib. The two y axis in my plot use different starting point in the graph, How can I correct it so that both the y axis plots use the same axis points.
The code I use to plot is
fig = plt.figure(figsize=(30, 20))
ax = fig.add_subplot()
ax1 =ax.twinx()
#ax.grid(True,axis='both')
#ax.set(xlabel="Voltage", ylabel="Current", title="IV Curve")
ax.set_xlabel("Voltage [V]",fontsize = 20)
ax1.set_xlabel("Voltage [V]",fontsize = 20)
ax.set_ylabel("Current [I]",fontsize = 20)
ax1.set_ylabel("Power [W]",fontsize = 20)
ax1.spines['right'].set_color('red')
ax.spines['left'].set_color('red')
ax.get_shared_x_axes().join(ax, ax1)
#ax.set_title("IV/PV Curve Plot",fontweight ='bold', fontsize = 30, color='blue')
ax1.tick_params(axis='both', which='both', labelsize=20)
plt.ylim (0,10) #adjust the current limits
plt.xlim (0,70) #adjust the voltage limits
ax.tick_params(axis='both', which='both', labelsize=20)
plt.ylim (0,400) #adjust the power limits
plt.xlim (0,70) #adjust the voltage limits
ax.plot('Voltage', 'Current', data=df, linewidth=4, label='IV curve')
ax1.plot('Voltage', 'Power', data=df, linewidth=4, color='r', label ='PV Curve')
ax.legend( loc='upper right',fontsize=20)
ax1.legend(loc='lower right',fontsize=20)
#pmax and Vmax
Pmax = df["Power"].max()
maxrow = df[df['Power']==Pmax]
Voltage = maxrow['Voltage'].iloc[0]
Current = maxrow['Current'].iloc[0]
xmax1 =(Voltage/70)
xmax2 =(Current/10)
ax.axhline(y=Current, xmin=0, xmax =xmax1,linewidth=4, color ='g',linestyle='--',)
ax.axvline(x=Voltage, ymin=0, ymax =xmax2, linewidth=4, color='g', linestyle='--')
#img = image.imread("/home/hebin/Desktop/PV/Mitsui/Flasher/Mitsui Logo.png")
#plt.figimage(img, 1380, 1150, alpha=1)
plt.margins(0)
plt.tight_layout()
#plt.savefig('/home/hebin/Desktop/PV/Mitsui/Flasher/IVC/IV.png')
In the image you can see the red line and the blue line starts at point zero but at different starting points. I want to correct it and make it start from the same point.