当前位置:网站首页>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()

边栏推荐
- Taro2.* applet configuration sharing wechat circle of friends
- Vipshop product details API interface (item_get- get vipshop product details interface), vipshop details API interface
- Final training simple address book c language
- Goahead webserver migration
- Top ten questions for senior Performance Test Engineer
- What is a SYN Flood attack? How to protect?
- DB queries the database, merges two unrelated tables, adds non-existent fields, and assigns default values
- If the evaluation conclusion of waiting insurance is poor, does it mean that waiting insurance has been done in vain?
- Summary of document level symbols under different systems
- Huawei cloud AOM version 2.0 release
猜你喜欢

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

Matlab adds noise / disturbance to data

ASP using panel to realize simple registration page

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

Summary of document level symbols under different systems

美国隧道法ASTM E84 表面阻燃测试

Data mining review

JD alliance API - universal chain transfer interface - Jingpin library interface - Interface Customization

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

Golang operation etcd
随机推荐
Realization of graduation project topic selection system based on JSP
Weibo comments on high availability and high performance computing architecture
Simple application and configuration of Rsync
Datakit acts as an API server for local data acquisition
Automatic reply of wechat bulletin number intelligent reply with Turing robot
Layer 3 loop brought by route Summary - solution experiment
Goahead translation - Active Server Pages
Huawei cloud AOM version 2.0 release
How to use SMS to deliver service information to customers? The guide is here!
生产环境AIX小机报错B6267342问题处理
铝板AS/NZS 1530.1 不燃性材料的阻燃测试
JD alliance API - universal chain transfer interface - Jingpin library interface - Interface Customization
Top ten questions for senior Performance Test Engineer
As a developer, you need to know about the codeless development platform IVX
Yolov6 training your own data record +yolov5 comparison test
leetcode:724. Find the central subscript of the array
Taro applet enables wxml code compression
Type of radar
Realize inotify and Rsync real-time backup
Bs-gx-018 student examination system based on SSM