python 界面设计 插入表格使用matplotlib模块 由于 有的数据太多 显示不全 怎么办
#画表格
self.ax2.cla()
tab=self.ax2.table(
cellText=[[i] for i in y],
#colLabels=['Error Code'],
colLabels=['number'],
rowLabels=x,
rowLoc="center",
loc="center" ,
cellLoc="center"
)
tab.scale(1,2)
self.ax2.axis('off')
self.fig2.draw()
考虑过拓展画布大小嘛?
思路一:缩小图像
思路二:放大画布,参考官网:https://matplotlib.org/stable/api/_as_gen/matplotlib.pyplot.figure.html
显示表格的话,就不要用matplotlib
模块,而采用PyQt模块中的QTableWidget或QTableView来实现,这样的话,如果数据过多的话,会自动显示滚动条。
换一个用法吧,用PyQt
中的QTableWidge
,这样数据过多就会出现滑动条,就不会有这个问题了