【发布时间】:2021-09-21 20:30:47
【问题描述】:
我有使用 matplotlib 绘制的数字列表。
# x, y1, y2, y3 array of points.
list_of_plots = []
for i in range(0, 100, 1):
x, y1, y2, y3 = get_points_array(i)
fig = plt.figure(i)
plt.plot(x, y1, '--rs', label='y1')
plt.plot(x, y2, '-g*', label='y2')
plt.plot(x, y3, ':bo', label='y3')
list_of_plots.append(fig)
plt.close()
通过这段代码,我得到了不同地块的列表。
print(list_of_plots)
图形大小 640x480 带 1 个轴>, ,, ,, ,...
我有一个由 PyQT5 制作的 GUI。我想在 QHBoxLayout 中显示 3 个特定的图
self.second_row = QtWidgets.QHBoxLayout()
#list_of_plots[0], list_of_plots[1], list_of_plots[2] will show inside second_row.
我查遍了互联网,但找不到任何线索。我不想将图形保存为 .png 格式,然后在布局上显示,因为过多图像的积累会导致内存大小不足。
【问题讨论】:
标签: python matplotlib pyqt pyqt5