当前位置:网站首页>Matplotlib draws a histogram and adds values to the graph
Matplotlib draws a histogram and adds values to the graph
2022-07-06 23:43:00 【L-M-Y】
matplotlib For details of drawing, please refer to the above :
https://blog.csdn.net/qq_52109814/article/details/121901438?spm=1001.2014.3001.5501
from matplotlib import pyplot as plt
import numpy as np
# Edit legend
def autolabel(rects):
for rect in rects:
height = rect.get_height()
# Set legend font 、 Location 、 Values, etc
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()
Run the example :
边栏推荐
- The programmer refused the offer because of low salary, HR became angry and netizens exploded
- What should I do if the USB flash disk data is formatted and how can I recover the formatted USB flash disk data?
- Coscon'22 community convening order is coming! Open the world, invite all communities to embrace open source and open a new world~
- flinksql select id ,count(*) from a group by id .
- [OFDM communication] OFDM system signal detection based on deep learning with matlab code
- 今日睡眠质量记录78分
- leetcode:236. 二叉树的最近公共祖先
- Docker starts MySQL and -emysql_ ROOT_ Password = my secret PW problem solving
- Wu Enda 2022 machine learning course evaluation is coming!
- koa2对Json数组增删改查
猜你喜欢
《数字经济全景白皮书》保险数字化篇 重磅发布
Gold three silver four, don't change jobs
Eureka Client启动后就关闭 Unregistering application xxx with eureka with status DOWN
How to implement Lua entry of API gateway
js对JSON数组的增删改查
浅谈现在的弊端与未来的发展
What should I do if the USB flash disk data is formatted and how can I recover the formatted USB flash disk data?
Gradle知识概括
JDBC programming of MySQL database
AI金榜题名时,MLPerf榜单的份量究竟有多重?
随机推荐
Master binary tree in one article
Experiment 5: common automation libraries
Gpt-3 is a peer review online when it has been submitted for its own research
氢创未来 产业加速 | 2022氢能专精特新创业大赛报名通道开启!
士大夫哈哈哈
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
B站大佬用我的世界搞出卷积神经网络,LeCun转发!爆肝6个月,播放破百万
Wasserstein slim gain with gradient poverty (wsgain-gp) introduction and code implementation -- missing data filling based on generated countermeasure network
快讯 l Huobi Ventures与Genesis公链深入接洽中
(1)长安链学习笔记-启动长安链
人均瑞数系列,瑞数 4 代 JS 逆向分析
请问oracle-cdc用JsonDebeziumDeserializationSchema反序列化
每年 2000 亿投资进入芯片领域,「中国芯」创投正蓬勃
flinksql select id ,count(*) from a group by id .
Gold three silver four, don't change jobs
若依请求url中带有jsessionid的解决办法
Can online reload system software be used safely? Test use experience to share with you
Today, I met a senior test developer from Tencent and saw the ceiling of the foundation
Newsletter L Huobi ventures is in-depth contact with genesis public chain
快手的新生意,还得靠辛巴吆喝?