1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
import os import matplotlib.pyplot as plt from numpy.random import randn os.chdir(r'D:\data\scripts\web1\ex21') os.getcwd() fig,ax = plt.subplots(2,2,sharex=True,sharey=True) for i in range(2): for j in range (2): ax[i,j].hist(randn(500),bins=50,color='k',alpha=0.5) plt.subplots_adjust(wspace=0,hspace=0) fig.suptitle('Figure with no inter-subplot spacing') plt.savefig("example21.png", dpi=100) plt.show() plt.close() <img class=" wp-image-115 aligncenter" src="https://gantovnik.com/bio-tips/wp-content/uploads/2019/01/example21.png" alt="example21" width="566" height="377" /> |
Recent Comments