当前位置:网站首页>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 :
边栏推荐
- After 3 years of testing bytecan software, I was ruthlessly dismissed in February, trying to wake up my brother who was paddling
- Computer reinstallation system teaching, one click fool operation, 80% of people have learned
- Gold three silver four, don't change jobs
- STM32通过串口进入和唤醒停止模式
- Two week selection of tdengine community issues | phase II
- koa2对Json数组增删改查
- Should the jar package of MySQL CDC be placed in different places in the Flink running mode?
- (1) Chang'an chain learning notes - start Chang'an chain
- Laravel8 uses passport authentication to log in and generate a token
- leetcode:236. The nearest common ancestor of binary tree
猜你喜欢
Please help xampp to do sqlilab is a black
AI表现越差,获得奖金越高?纽约大学博士拿出百万重金,悬赏让大模型表现差劲的任务...
Isomorphism + cross end, knowing applet +kbone+finclip is enough!
docker启动mysql及-eMYSQL_ROOT_PASSWORD=my-secret-pw问题解决
B站大佬用我的世界搞出卷积神经网络,LeCun转发!爆肝6个月,播放破百万
基础图表解读“东方甄选”爆火出圈数据
The best sister won the big factory offer of 8 test posts at one go, which made me very proud
AI金榜题名时,MLPerf榜单的份量究竟有多重?
leetcode:236. 二叉树的最近公共祖先
设计一个抢红包系统
随机推荐
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.
Station B boss used my world to create convolutional neural network, Lecun forwarding! Burst the liver for 6 months, playing more than one million
A few suggestions for making rust library more beautiful! Have you learned?
Wasserstein Slim GAIN with Gradient Penalty(WSGAIN-GP)介绍及代码实现——基于生成对抗网络的缺失数据填补
Isomorphism + cross end, knowing applet +kbone+finclip is enough!
使用MitmProxy离线缓存360度全景网页
Summary of three methods for MySQL to view table structure
Win11怎么恢复传统右键菜单?Win11右键改回传统模式的方法
What does security capability mean? What are the protection capabilities of different levels of ISO?
JS import excel & Export Excel
Gradle knowledge generalization
每人每年最高500万经费!选人不选项目,专注基础科研,科学家主导腾讯出资的「新基石」启动申报...
(LeetCode)两数之和
The programmer said, "I'm 36 years old, and I don't want to be rolled, let alone cut."
Wu Enda 2022 machine learning course evaluation is coming!
短链的设计
内网穿透zerotier 外网(手机、电脑等)访问内网设备(树莓派、NAS、电脑等)
Stop saying that microservices can solve all problems
What should I do if the USB flash disk data is formatted and how can I recover the formatted USB flash disk data?
Today's sleep quality record 78 points