我想从96个文件中创建直方图。
import glob
import laspy
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
path = 'files/*.las'
files = glob.glob(path)
plt.figure(figsize=(35,25))
sns.set(font_scale =3)
for f in files:
infile = laspy.file.File(f, mode="r")
coords = np.vstack((infile.x, infile.y, infile.z)).transpose()
height = coords[:, 2]
sns.distplot(height, hist = True, kde = True, norm_hist = False, bins=36,
hist_kws={'edgecolor':'black'}, vertical = True)
上面的代码为所有文件创建1个直方图。我希望每4个文件有一个单独的直方图,所以我将有24个直方图代表96个文件。有人可以帮忙解决这个问题吗?