当前位置:网站首页>ax.patches 表示什么?
ax.patches 表示什么?
2022-08-08 06:20:00 【波尔德】
ax.patches 表示条形图中的每一个矩形
原图:
现在,我们为每个立柱增加对应的数值显示:
fig,ax = plt.subplots(figsize=(20,10), dpi=80)# 确定图的位置
ax.set_title("巡数分布") # 给图增加title
sns.countplot(x="totalsplist",data=tlj_data) #左图
#在直方图上显示具体数值
for p in ax.patches:
# 在每个矩形上增添数值
ax.annotate(f'\n{
p.get_height()}', (p.get_x(), p.get_height()+50), color='black', size=15)
plt.show()
增添完成后的效果图如图所示:
边栏推荐
猜你喜欢
随机推荐
nacos的配置中心
整数分块例题
File Operations - IO
selenium模拟登录某宝
Educational Codeforces Round 133 (Rated for Div. 2) C Supplement
MySQL6
Efficient and beautiful scrolling component Slivers of Flutter tutorial (tutorial includes source code)
字符串题目解析
七千字带你了解封装等机制
cnn convolutional neural network backpropagation, convolutional neural network dimension change
研发医疗器械产品需要做的测试
验证的计划
Leetcode sword 】 refers to the Offer (special commando) summary
数字IC设计中为什么要避免锁存器(Latches)
Basic tools - NETCAT (Telnet - banner, transfer text message)
Preprocessing Notes
Educational Codeforces Round 133 (Rated for Div. 2) C补题
docker修改mysql配置文件
MySQL5
The pta patching simple graph theory









