当前位置:网站首页>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 :
边栏推荐
- 亚朵三顾 IPO
- The best sister won the big factory offer of 8 test posts at one go, which made me very proud
- 谁说新消费品牌大溃败?背后有人赢麻了
- The programmer said, "I'm 36 years old, and I don't want to be rolled, let alone cut."
- Efficient ETL Testing
- JDBC programming of MySQL database
- 请问oracle-cdc用JsonDebeziumDeserializationSchema反序列化
- leetcode:236. The nearest common ancestor of binary tree
- Cover fake big empty talk in robot material sorting
- Please help xampp to do sqlilab is a black
猜你喜欢

STM32通过串口进入和唤醒停止模式
Implementation steps of mysql start log in docker

Today, I met a senior test developer from Tencent and saw the ceiling of the foundation

快讯 l Huobi Ventures与Genesis公链深入接洽中

AI金榜题名时,MLPerf榜单的份量究竟有多重?

Master binary tree in one article

11 preparations for Web3 and Decentralization for traditional enterprises

【通信】两层无线 Femtocell 网络上行链路中的最优功率分配附matlab代码

内网穿透zerotier 外网(手机、电脑等)访问内网设备(树莓派、NAS、电脑等)

求帮助xampp做sqlilab是一片黑
随机推荐
The tutorial of computer reinstallation win10 system is simple and easy to understand. It can be reinstalled directly without U disk
《数字经济全景白皮书》保险数字化篇 重磅发布
B站大佬用我的世界搞出卷積神經網絡,LeCun轉發!爆肝6個月,播放破百萬
实现多彩线条摆出心形
[212] what are three methods for PHP to send post requests
Efficient ETL Testing
Ajout, suppression et modification d'un tableau json par JS
【系统分析师之路】第七章 复盘系统设计(面向服务开发方法)
MATLIB从excel表中读取数据并画出函数图像
I've been laid off, and I'll lose money for everything. The days when I once made a monthly salary of 20000 are not coming back
自动更新Selenium驱动chromedriver
Newsletter L Huobi ventures is in-depth contact with genesis public chain
短链的设计
mysql-cdc 的jar包 ,在flink运行模式下,是不是要放在不同的地方呢?
JDBC programming of MySQL database
flinksql select id ,count(*) from a group by id .
Experiment 6: installing eve-ng
Docker mysql5.7 how to set case insensitive
docker启动mysql及-eMYSQL_ROOT_PASSWORD=my-secret-pw问题解决
STM32通过串口进入和唤醒停止模式