I want the scaling to be the same for my two subplots to make them comparable, but the limits should be set automatically. Here a small working example:
import matplotlib.pyplot as plt
import numpy as np
time = range(20)
y1 = np.random.rand(20)*2
y2 = np.random.rand(20) + 10
fig, axes = plt.subplots(2, figsize=(10,4), sharex=True, sharey=True)
# OPTION 2: fig, axes = plt.subplots(2, figsize=(10,4))
axes[0].plot(time, y1)
axes[1].plot(time, y2)
plt.show()
The plot looks like this:
and with option 2 uncommented it looks like this:
In the second plot, it looks like y1 and y2 are equally noisy which is wrong, but in plot 1 the axis limits are too high/low.


