LSL*_*LSL 5 python for-loop matplotlib batch-processing subplot
目标:使用 for 循环生成 100 个条形图,并将输出显示为子图图像
数据格式:具有 101 列的数据文件。最后一列是 X 变量;剩下的 100 列是 Y 变量,针对这些变量绘制了 x。
所需输出:5 x 20 子图阵列中的条形图,如本示例图像所示:
当前方法:我一直在 seaborn 中使用 PairGrid,它生成一个 nx 1 数组:
.
其中输入==数据帧;input3 == 调用列标题的列表:
for i in input3:
plt.figure(i)
g = sns.PairGrid(input,
x_vars=["key_variable"],
y_vars=i,
aspect=.75, size=3.5)
g.map(sns.barplot, palette="pastel")
Run Code Online (Sandbox Code Playgroud)
有没有人有任何想法如何解决这个问题?
| 归档时间: |
|
| 查看次数: |
5962 次 |
| 最近记录: |