matplotlib set spacing between subplots code example
Example 1: matplotlib space between subplots
import matplotlib.pyplot as plt
matplotlib.pyplot.subplots_adjust(wspace=X, hspace=Y)
# Adjust X for width between subplots
# Adjust Y for height between subplots
Example 2: separate subplots in python
plt.tight_layout()