I have two axes. I want to plot 4e-6 in ax1 and plot 4e-7 in ax2. How can I make y-axis of ax1 like y-axis of ax2? i.e, it should be scaled to 1e-6 and the scale should appear at the top of the y-axis.
Here is the code:
import matplotlib.pyplot as plt
import numpy as np
fig = plt.figure(figsize=(10,5))
ax1 = fig.add_subplot(121)
ax2 = fig.add_subplot(122)
x = np.linspace(0, 1000, 3)
y1 = np.full_like(x, 4e-6)
y2 = np.full_like(x, 4e-7)
ax1.plot(x, y1)
ax2.plot(x, y2)
plt.show()
Here is the figure:

