当前位置:网站首页>matplotlib画柱状图并添加数值到图中
matplotlib画柱状图并添加数值到图中
2022-07-06 15:59:00 【L-M-Y】
matplotlib画图细节可参考前文:
https://blog.csdn.net/qq_52109814/article/details/121901438?spm=1001.2014.3001.5501
from matplotlib import pyplot as plt
import numpy as np
#编辑图例
def autolabel(rects):
for rect in rects:
height = rect.get_height()
#设置图例字体、位置、数值等等
plt.text(rect.get_x(), 1.01*height, '%s' %
float(height), size=11, family="Times new roman")
y = ['A', 'B', 'C', 'D', 'E', 'F']
x = [6.624, 7.394, 14.972, 17.545, 21.239, 16.736]
rect = plt.bar(y, x, width=0.5)
autolabel(rect)
plt.title("Overall Value S")
plt.xlabel("Area")
plt.ylabel("Variance")
plt.legend()
plt.show()
运行示例:
边栏推荐
- Cover fake big empty talk in robot material sorting
- Isomorphism + cross end, knowing applet +kbone+finclip is enough!
- 云原生(三十二) | Kubernetes篇之平台存储系统介绍
- The problem of ASP reading Oracle Database
- Master binary tree in one article
- Implementation steps of mysql start log in docker
- Gpt-3 is a peer review online when it has been submitted for its own research
- 亚朵三顾 IPO
- A few suggestions for making rust library more beautiful! Have you learned?
- 吴恩达2022机器学习课程评测来了!
猜你喜欢
Koa2 addition, deletion, modification and query of JSON array
Example code of MySQL split string as query condition
使用MitmProxy离线缓存360度全景网页
Ajout, suppression et modification d'un tableau json par JS
Detailed explanation of regular expression (regexp) in MySQL
leetcode:236. 二叉树的最近公共祖先
浅谈现在的弊端与未来的发展
js對JSON數組的增删改查
借助这个宝藏神器,我成为全栈了
Flutter life cycle
随机推荐
The same job has two sources, and the same link has different database accounts. Why is the database list found in the second link the first account
[communication] optimal power allocation in the uplink of two-layer wireless femtocell network with matlab code
Docker starts MySQL and -emysql_ ROOT_ Password = my secret PW problem solving
【通信】两层无线 Femtocell 网络上行链路中的最优功率分配附matlab代码
请问async i/o可以由udf算子实现然后用sql api调用吗?目前好像只看到Datastre
资产安全问题或制约加密行业发展 风控+合规成为平台破局关键
The intranet penetrates the zerotier extranet (mobile phone, computer, etc.) to access intranet devices (raspberry pie, NAS, computer, etc.)
Use mitmproxy to cache 360 degree panoramic web pages offline
Leetcode problem solving - 889 Construct binary tree according to preorder and postorder traversal
Summary of three methods for MySQL to view table structure
mysql连接vscode成功了,但是报这个错
求帮助xampp做sqlilab是一片黑
docker启动mysql及-eMYSQL_ROOT_PASSWORD=my-secret-pw问题解决
(1)长安链学习笔记-启动长安链
js导入excel&导出excel
Wasserstein slim gain with gradient poverty (wsgain-gp) introduction and code implementation -- missing data filling based on generated countermeasure network
浅谈现在的弊端与未来的发展
Win11怎么恢复传统右键菜单?Win11右键改回传统模式的方法
Wu Enda 2022 machine learning course evaluation is coming!
With the help of this treasure artifact, I became the whole stack