Предполагая, что вы создали графики с общей осью, вам просто нужно изменить диапазон y для центрирования в нуле или иметь одинаковый множитель смещения на обоих графиках (т.е. установить ax.set_ylim(-6,6)
для обоих графиков).Следующий код является примером.
from matplotlib import pyplot as plt
import numpy as np
#Create some Fake Data
x =np.arange(-10,10)
y = x+np.random.rand(20)
y2 = 0.5*x-3.*np.random.rand(20)
#Figure
fig = plt.figure(figsize=(12,6))
#First subplot with zero line not even
ax1 = plt.subplot(121)
ax2 = ax1.twinx()
ax1.plot(x,y,c='r')
ax2.plot(x,y2,c='b')
ax1.axhline(0)
#Second Subplot with zero line the same on both axes
ax3 = plt.subplot(122)
ax4 = ax3.twinx()
ax3.plot(x,y,c='r')
ax4.plot(x,y2,c='b')
ax3.axhline(0)
#If you set your limits on both sides to have the same interval you will get the same zero line
ax3.set_ylim(-10,10)
ax4.set_ylim(-6,6)
plt.show()
