share x axis matplotlib
fig=plt.figure()
ax1 = plt.subplot(211)
ax2 = plt.subplot(212, sharex = ax1)
share x axis matplotlib
fig=plt.figure()
ax1 = plt.subplot(211)
ax2 = plt.subplot(212, sharex = ax1)
subplots
# new style method 1; unpack the axes
fig, ((ax1, ax2), (ax3, ax4)) = plt.subplots(2, 2, sharex=True, sharey=True)
ax1.plot(x)
subplots
import matplotlib.pyplot as plt
rows, cols = 2, 3
fig, ax = plt.subplots(rows, cols,
sharex='col',
sharey='row')
for row in range(rows):
for col in range(cols):
ax[row, col].text(0.5, 0.5,
str((row, col)),
color="green",
fontsize=18,
ha='center')
plt.show()
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us