当前位置:网站首页>Matplotlib histogram
Matplotlib histogram
2022-06-29 22:06:00 【starmultiple】
from matplotlib import pyplot as plt
a=[131,106,109,121,101,116,119,116,134,143,146,149,150,147,178,157,163,169,134,127,128,129,131,98,125,131,124,139,123,155,96,98,105,174,146,156,131,114,114,165,167,113,144,136,148,94,134,167,104]
# Compute arrays
d=3
# Number of split groups
num_bins=(max(a)-min(a))//d
print(max(a),min(a),max(a)-min(a))
print(num_bins)
# Set the size of the graph
plt.figure(figsize=(20,8),dpi=80)
plt.hist(a,num_bins,density=1)
# Set up x Axis scale
plt.xticks(range(min(a),max(a)+d,d))
plt.grid()
plt.show()
Histogram
Movie box office
from matplotlib import pyplot as plt
plt.rcParams['font.sans-serif'] = ['Microsoft YaHei']
a=[" Warwolf 2"," Fast and furious 8"," Kung Fu Yoga "," The west journey fu demon "," The transformers 5: The last Knight "," Wrestling, Dad "]
b=[56.01, 26.94, 17.53, 16.49, 15.45, 12.96]
# Set graphic size
plt.figure(figsize=(20,12),dpi=80)
# Draw a bar graph
plt.bar(a,b,width=0.3)
plt.xticks(a,a)
plt.show()

边栏推荐
- Golang operation etcd
- 唯品会关键词搜索API接口(item_search-按关键字搜索唯品会商品API接口),唯品会API接口
- How do new shareholders open accounts online? Is it safe to open an account online?
- Huawei cloud AOM version 2.0 release
- [force deduction 10 days SQL introduction] day7+8 calculation function
- ASP.NET 跨页面提交(Button控件页面重定向)
- STM32 minimum system construction (schematic diagram)
- 89. (cesium article) cesium aggregation diagram (custom picture)
- 软件快速交付真的需要以安全为代价吗?
- BUAA OO unit 4 HW16 unit 4 Summary and course review
猜你喜欢

Hardware development notes (VIII): basic process of hardware development, making a USB to RS232 module (VII): creating a basic dip component (crystal oscillator) package and associating the principle

Bs-gx-017 online examination management system based on SSM

After inventing anti-virus software, he chose to be a top-notch gangster

ASP using panel to realize simple registration page

ASP.NET 跨页面提交(Button控件页面重定向)

2022 openvino DevCon unveils secrets! Intel and many partners deepen the construction of developer ecology and release the innovation potential of AI industry

American tunneling ASTM E84 surface flame retardant test

Cloud native database query optimization - statistics and row count estimation

Layer 3 loop brought by route Summary - solution experiment

Threejs basic introduction
随机推荐
Golang operation etcd
CLI tool foundation of ros2 robot f1tenth
Introduction to gaofen-3 satellite (GF-3)
Data mining review
Is it safe to bind securities accounts to flush? Which securities firm can bind flush after opening an account
阿里巴巴店铺的所有商品API接口(item_search_shop-获得店铺的所有商品接口),阿里巴巴API接口
The database of the server cannot be connected [the service has been started, the firewall has been closed, the port has been opened, and the netlent port is not connected]
数论-整除分块
Taro applet enables wxml code compression
What is a SYN Flood attack? How to protect?
yolov6训练自己的数据记录+yolov5对比测试
Bs-gx-017 online examination management system based on SSM
Cloud native database query optimization - statistics and row count estimation
As for the domestic Kirin system running QT, it can be run on the command line but cannot be run by double clicking (no response)
BUAA OO unit 4 HW16 unit 4 Summary and course review
JD alliance API - universal chain transfer interface - Jingpin library interface - Interface Customization
Db查询数据库合并两个不相关的表,新增不存在的字段,并赋予默认值
Graduation summary of construction practice camp
Layer 3 loop brought by route Summary - solution experiment
Which brokerage commission is the lowest and safest