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

边栏推荐
- ASP利用Panel实现简易注册页面
- As a developer, you need to know about the codeless development platform IVX
- ASP. Net cross page submission (button control page redirection)
- Visual analysis and display effect of summer data
- 【ROS进阶篇】第四讲 ROS中的重名问题(节点、话题与参数)
- The explain function of the DALEX package of R language generates a machine learning model interpreter and predict for the specified classification prediction_ The parts function analyzes the contribu
- 89. (cesium article) cesium aggregation diagram (custom picture)
- 什么是 SYN 洪水攻击?如何防护?
- CSDN failed to replicate problem
- Win10添加ssh公钥
猜你喜欢

这次跟大家聊聊技术,也聊聊人生

Detailed explanation of MySQL and mvcc and the difference between RC and RR for snapshot reading
![[advanced ROS] Lecture 3 ROS file system and distributed communication](/img/9f/2c316f5b0aa36b63769672048da772.png)
[advanced ROS] Lecture 3 ROS file system and distributed communication

Sophon CE community edition goes online, and free get is a lightweight, easy-to-use, efficient and intelligent data analysis tool

Matlab adds noise / disturbance to data

细说GaussDB(DWS)复杂多样的资源负载管理手段

DevCloud加持下的青软,让教育“智”上云端

American tunneling ASTM E84 surface flame retardant test

89. (cesium article) cesium aggregation diagram (custom picture)

Data mining review
随机推荐
R language plot visualization: plot visualization box graph and several box plots of multiple classification variables
C. Most Similar Words
Numpy's research imitation 1
Huawei cloud AOM version 2.0 release
State management uses session to restrict page access. Only login can verify sessionlogin Aspx can access session aspx
Introduction to gaofen-3 satellite (GF-3)
Layer 3 loop brought by route Summary - solution experiment
夏日彩虹来下饭
ASP利用Panel实现简易注册页面
Graduation summary of construction practice camp
尚硅谷实时数据仓库项目(阿里云实时数仓)
Cout ambiguous problem
A. Beat The Odds
生产环境AIX小机报错B6267342问题处理
唯品会商品详情API接口(item_get-获得唯品会商品详情接口),唯品会详情API接口
American tunneling ASTM E84 surface flame retardant test
唯品会关键词搜索API接口(item_search-按关键字搜索唯品会商品API接口),唯品会API接口
Reflections on remote sensing image interpretation
铝板AS/NZS 1530.1 不燃性材料的阻燃测试
阿里巴巴店铺的所有商品API接口(item_search_shop-获得店铺的所有商品接口),阿里巴巴API接口