python向图标添加表格

import matplotlib.pyplot as plt
import numpy as np
from matplotlib import patheffects

# plt.figure()
#
# ax = plt.gca()

y = np.random.random(9)

col_tables = ['col1','col2','col3']

row_tables = ['row1','row2','row3']

table_values = [[11,12,13],[21,22,23],[28,29,30]]

row_colors = ['red','green','blue']

my_table = plt.table(cellText=table_values,
                     colWidths=[0.1]*3,
                     rowLabels=row_tables,
                     colLabels=col_tables,
                     rowColours=row_colors,
                     loc = 'upper right')


plt.show()

上面代码可以制作出一个表格

猜你喜欢

转载自blog.csdn.net/lv941002/article/details/83586413
今日推荐