当前位置:网站首页>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()
增添完成后的效果图如图所示:
边栏推荐
猜你喜欢
随机推荐
“独家全新”MySQL进阶套餐,你确定不看吗?
oracle insert sql error
请问学习MySQL应该安装哪个版本,现在哪个版本使用最多?
【分布式】链路追踪 jaeger
Tensorboard的使用 ---- SummaryWriter类(pytorch版)
李沐老师 PyTorch版——线性回归 + softmax回归的简洁实现(3)
图解LeetCode——636. 函数的独占时间(难度:中等)
字符串题目解析
pta补坑简单图论
状态压缩复习
仿记事本;QFile
【MySQL】——事务的基本概念
【u-boot】u-boot的驱动模型分析
Rust学习:4_基本类型
How to batch import files and rename them all to the same file name
Threads, control, communications
Why should Latches be avoided in digital IC design?
Integer block sample
postgres 安装 14 版本出现错误提示解决办法
缓存存在的问题:缓存穿透、缓存击穿、缓存雪崩








