用python的画表格
来源:互联网 发布:linux squid 编辑:程序博客网 时间:2024/05/22 09:38
%matplotlib inline
from matplotlib import pyplot as plt
import numpy as np
randn = np.random.randn
from pandas import *
idx = Index(np.arange(1,7))
df = DataFrame(randn(6, 4), index=idx, columns=['A', 'B', 'C', 'D'])
vals = np.around(df.values,2)
fig = plt.figure(figsize=(9,4))
ax = fig.add_subplot(111, frameon=True, xticks=[], yticks=[])
the_table=plt.table(cellText=vals, rowLabels=df.index, colLabels=df.columns,
colWidths = [0.1]*vals.shape[1], loc='center',cellLoc='center')
the_table.set_fontsize(20)
from matplotlib import pyplot as plt
import numpy as np
randn = np.random.randn
from pandas import *
idx = Index(np.arange(1,7))
df = DataFrame(randn(6, 4), index=idx, columns=['A', 'B', 'C', 'D'])
vals = np.around(df.values,2)
fig = plt.figure(figsize=(9,4))
ax = fig.add_subplot(111, frameon=True, xticks=[], yticks=[])
the_table=plt.table(cellText=vals, rowLabels=df.index, colLabels=df.columns,
colWidths = [0.1]*vals.shape[1], loc='center',cellLoc='center')
the_table.set_fontsize(20)
the_table.scale(2.5,2.58)
使用matplot表值画图的图例调整为表格
缺点是:不能像数据框一样对齐
阅读全文
0 0
- 用python的画表格
- Python 表格的MVC 模式
- Python用treeview模拟表格的简单栗子
- 【python】用selenium webdriver做简单的表格提交
- python表格。。。
- 用Python将多个excel表格合并为一个表格
- Python之表格的合并单元格
- python对xlsx表格的操作
- python读取表格csv的方法
- python 生成巨大的excel表格xlsxwriter
- python生成带有表格的图片
- 用latex的multirow包画表格
- Python用列表生成html表格
- 用python发送表格数据到邮箱
- 用xlrd读取excel表格(python)
- 预约用的表格
- 用python-docx修改已存在的Word文档的表格的字体格式:
- 用python + openpyxl处理excel(07+)多文档合并+表格合并 + 一些中文处理的技巧
- 从零开始安装使用ceph
- 请描述MySql从安装到配置的全部详细过程(确保一台新电脑可以顺利使用mysql)
- springMvc注解@ControllerAdvice,@InitBinder,@CrossOrigin,@CookieValue
- C# 实现安装C#写的系统服务 不依赖InstallUtil
- 三分钟掌握数据中心“容灾和备份的区别”
- 用python的画表格
- 所谓的沉浸式状态栏---
- 阿里再推内置锂电池服务器 Facebook等国际巨头也上马相关技术
- springMVC入门--3.数据校验
- 从好耶牵手海航集团看海航集团怎么样
- 应工程师需求,今天来盘点一下常见总线类型(干货版)
- 计蒜课:泥塑课
- PyQt5中的事件和信号
- mysql服务提示无法启动(3523报错)