当前位置:网站首页>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 :
边栏推荐
- Automatically update selenium driver chromedriver
- The important data in the computer was accidentally deleted by mistake, which can be quickly retrieved by this method
- 设计一个抢红包系统
- Ajout, suppression et modification d'un tableau json par JS
- [communication] optimal power allocation in the uplink of two-layer wireless femtocell network with matlab code
- Today, I met a senior test developer from Tencent and saw the ceiling of the foundation
- 【无人机】多无人协同任务分配程序平台含Matlab代码
- Zero code and high return. How to use 40 sets of templates to meet 95% of the reporting needs in the work
- Can async i/o be implemented by UDF operator and then called by SQL API? At present, it seems that only datastre can be seen
- Efficient ETL Testing
猜你喜欢

Gradle知识概括

Station B boss used my world to create convolutional neural network, Lecun forwarding! Burst the liver for 6 months, playing more than one million

js對JSON數組的增删改查

11 preparations for Web3 and Decentralization for traditional enterprises

With the help of this treasure artifact, I became the whole stack

浅谈现在的弊端与未来的发展

Newsletter L Huobi ventures is in-depth contact with genesis public chain

(1) Chang'an chain learning notes - start Chang'an chain

Gradle knowledge generalization

资产安全问题或制约加密行业发展 风控+合规成为平台破局关键
随机推荐
Cloud native (32) | kubernetes introduction to platform storage system
koa2对Json数组增删改查
Oracle对表进行的常用修改命令
达晨史上最大单笔投资,今天IPO了
Asset security issues or constraints on the development of the encryption industry, risk control + compliance has become the key to breaking the platform
Detailed explanation of regular expression (regexp) in MySQL
Coscon'22 community convening order is coming! Open the world, invite all communities to embrace open source and open a new world~
Nftscan Developer Platform launches Pro API commercial services
Computer reinstallation system teaching, one click fool operation, 80% of people have learned
CRMEB 商城系统如何助力营销?
问下各位,有没有flink sql生成作业的文档啊或是案列啊知道flink cli可以建表和指定目
今日睡眠质量记录78分
Scholar doctor hahaha
A few suggestions for making rust library more beautiful! Have you learned?
Where does this "judge the operation type according to the op value and assemble SQL by yourself" mean? It means simply using Flink tab
本地部署 zeppelin 0.10.1
【无人机】多无人协同任务分配程序平台含Matlab代码
不要再说微服务可以解决一切问题了
The problem of ASP reading Oracle Database
Talking about the current malpractice and future development