双子图共享 Y 轴:
import matplotlib.pyplot as plt
import numpy as np
# First create some toy data:
x = np.linspace(0, 2*np.pi, 400)
y = np.sin(x**2)
# Create two subplots and unpack the output array immediately
f, (ax1, ax2) = plt.subplots(1, 2, sharey=True)
ax1.plot(x, y)
ax1.set_title('Sharing Y axis')
ax2.scatter(x, y)
多子图共享 X 轴:
# Share a X axis with each column of subplots