matplotlib之table详细使用、使用matplotlib绘制表格
参数解释详情
表格一般通常和其他图组合使用
cellText:表格的数值,将源数据按照行进行分组,每组数据放在列表里存储,所有组数据再放在列表里储存。
cellLoc:表格中的数据对齐位置,可以左对齐、居中和右对齐。
colWidths:表格每列的宽度。
colLabels:表格每列的列名称。
colColours:表格每列的列名称所在单元格的颜色。
rowLabels:表格每行的行名称。
rowLoc:表格每行的行名称对齐位置,可以左对齐、居中和右对齐。(同理也有colLoc)
loc:表格在画布中的位置。位置大致有以下:upper right、upper left、lower left、lower right、center left、center right、lower center、upper center、center、top right、top left、bottom left、bottom right、right、left、top、bottom
简单的使用案例
import matplotlib.pyplot as plt
import matplotlib as mpl
mpl.rcParams["font.sans-serif"]=["SimHei"]#展示中文字体
mpl.rcParams["axes.unicode_minus"]=False#处理负刻度值
kinds = ["简易箱","保温箱","行李箱","密封箱"]
colors = ["#e41a1c","#377eb8",