This ia a mwe, with 3 subplots. My goal is to sharex
for axes[0]
and axes[1]
only. axes[2]
should have different xlim
and wspace
. How I can do that?
#!/usr/bin/env python
import math
import random
import matplotlib.pyplot as plt
_, axes = plt.subplots(3, 1, figsize=(20, 6), sharex=True)
plt.subplots_adjust(wspace=0.05)
x = [random.triangular() for i in range(20)]
y = [random.gauss(0.5, 0.25) for i in range(20)]
axes[0].plot(x, y, "o")
axes[1].set_xlabel("Hello")
axes[1].plot(x, y, "o")
axes[2].set_xlim([0, .5])
axes[2].plot(x, y, "o")
plt.show()