当前位置:网站首页>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()
运行示例:
边栏推荐
- 借助这个宝藏神器,我成为全栈了
- Graphite document: four countermeasures to solve the problem of enterprise document information security
- MySQL implementation of field segmentation from one line to multiple lines of example code
- The tutorial of computer reinstallation win10 system is simple and easy to understand. It can be reinstalled directly without U disk
- Wu Enda 2022 machine learning course evaluation is coming!
- Leetcode problem solving - 889 Construct binary tree according to preorder and postorder traversal
- Experiment 6: installing eve-ng
- Gpt-3 is a peer review online when it has been submitted for its own research
- 传统企业要为 Web3 和去中心化做的 11 个准备
- The intranet penetrates the zerotier extranet (mobile phone, computer, etc.) to access intranet devices (raspberry pie, NAS, computer, etc.)
猜你喜欢
MySQL数据库之JDBC编程
The method of reinstalling win10 system is as simple as that
If the request URL contains jsessionid, the solution
Pdf batch splitting, merging, bookmark extraction, bookmark writing gadget
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
With the help of this treasure artifact, I became the whole stack
The programmer said, "I'm 36 years old, and I don't want to be rolled, let alone cut."
氢创未来 产业加速 | 2022氢能专精特新创业大赛报名通道开启!
Station B boss used my world to create convolutional neural network, Lecun forwarding! Burst the liver for 6 months, playing more than one million
11 preparations for Web3 and Decentralization for traditional enterprises
随机推荐
AI金榜题名时,MLPerf榜单的份量究竟有多重?
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
Today, I met a senior test developer from Tencent and saw the ceiling of the foundation
浅谈现在的弊端与未来的发展
Knowledge * review
MySQL数据库之JDBC编程
资产安全问题或制约加密行业发展 风控+合规成为平台破局关键
11 preparations for Web3 and Decentralization for traditional enterprises
Per capita Swiss number series, Swiss number 4 generation JS reverse analysis
达晨史上最大单笔投资,今天IPO了
Dockermysql modifies the root account password and grants permissions
B站大佬用我的世界搞出卷积神经网络,LeCun转发!爆肝6个月,播放破百万
【OFDM通信】基于深度学习的OFDM系统信号检测附matlab代码
koa2对Json数组增删改查
Wasserstein slim gain with gradient poverty (wsgain-gp) introduction and code implementation -- missing data filling based on generated countermeasure network
Laravel8 uses passport authentication to log in and generate a token
同一个作业有两个source,同一链接不同数据库账号,为何第二个链接查出来的数据库列表是第一个账号的
Microsoft win11 is still "unsatisfactory". Multi user feedback will cause frequent MSI crashes
COSCon'22 社区召集令来啦!Open the World,邀请所有社区一起拥抱开源,打开新世界~
人均瑞数系列,瑞数 4 代 JS 逆向分析