当前位置:网站首页>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()
运行示例:
边栏推荐
- (1) Chang'an chain learning notes - start Chang'an chain
- The worse the AI performance, the higher the bonus? Doctor of New York University offered a reward for the task of making the big model perform poorly
- 【无人机】多无人协同任务分配程序平台含Matlab代码
- JS addition, deletion, modification and query of JSON array
- 传统企业要为 Web3 和去中心化做的 11 个准备
- 每人每年最高500万经费!选人不选项目,专注基础科研,科学家主导腾讯出资的「新基石」启动申报...
- flinksql select id ,count(*) from a group by id .
- 自动更新Selenium驱动chromedriver
- Up to 5million per person per year! Choose people instead of projects, focus on basic scientific research, and scientists dominate the "new cornerstone" funded by Tencent to start the application
- 云原生(三十二) | Kubernetes篇之平台存储系统介绍
猜你喜欢

每日刷题记录 (十五)
![[launched in the whole network] redis series 3: high availability of master-slave architecture](/img/42/e67c7fa88e57c8ad3262552fd7b83c.png)
[launched in the whole network] redis series 3: high availability of master-slave architecture

What should I do if the USB flash disk data is formatted and how can I recover the formatted USB flash disk data?

NFTScan 开发者平台推出 Pro API 商业化服务

The intranet penetrates the zerotier extranet (mobile phone, computer, etc.) to access intranet devices (raspberry pie, NAS, computer, etc.)

Koa2 addition, deletion, modification and query of JSON array

(flutter2) as import old project error: inheritfromwidgetofexacttype

Experiment 4: installing packages from Gui

js对JSON数组的增删改查

Today's sleep quality record 78 points
随机推荐
AcWing 4299. Delete point
How much does the mlperf list weigh when AI is named?
不要再说微服务可以解决一切问题了
Gpt-3 is a peer review online when it has been submitted for its own research
[unmanned aerial vehicle] multi unmanned cooperative task allocation program platform, including Matlab code
Face recognition class attendance system based on paddlepaddle platform (easydl)
COSCon'22 社区召集令来啦!Open the World,邀请所有社区一起拥抱开源,打开新世界~
Devsecops software R & D security practice - release
GPT-3当一作自己研究自己,已投稿,在线蹲一个同行评议
借助这个宝藏神器,我成为全栈了
公链与私链在数据隐私和吞吐量上的竞争
PDF批量拆分、合并、书签提取、书签写入小工具
leetcode:236. 二叉树的最近公共祖先
MySQL connected vscode successfully, but this error is reported
docker启动mysql及-eMYSQL_ROOT_PASSWORD=my-secret-pw问题解决
Automatically update selenium driver chromedriver
请问async i/o可以由udf算子实现然后用sql api调用吗?目前好像只看到Datastre
亚朵三顾 IPO
JDBC programming of MySQL database
Station B Big utilise mon monde pour faire un réseau neuronal convolutif, Le Cun Forward! Le foie a explosé pendant 6 mois, et un million de fois.