python - 在栏中显示价值
问题描述
我一直在尝试运行以下代码:
df = alc_gasolina[(alc_gasolina['ANO'] == 2009) & (alc_gasolina['MÊS'] == 5)]
ax = sns.barplot(y="PREÇO MÉDIO REVENDA",x="DIA", hue="PRODUTO", data=df )
ax.set(ylim=(1.4,2.6))
for index, row in df.iterrows():
ax.text(row.DIA,row['PREÇO MÉDIO REVENDA'], round(row['PREÇO MÉDIO REVENDA'],2), color='black', ha="center")
结果是下图:(文本未对齐。)
有人可以帮忙吗?
解决方案
推荐阅读
- c# - 在 C# 中使用多线程屏蔽/过滤图像(Windows 窗体应用程序)
- sql - 使用子查询加入 2 个外键
- javascript - 向 AdonisJS 中的所有模型添加自定义函数
- undefined - 寻找未定义的符号:_ZN5boost11this_thread6hidden9sleep_forERK8timespec
- angular - 如何仅重置角度5中的特定表单字段
- reactjs - 尝试运行构建时出错
- c# - ASP.Net Core Razor Pages 动态列表
- java - 无法与 Instagram 登录字段交互
- php - 如何根据 PHP 表格列中的某些条件更改文本颜色
- java - FopFactory 类型中的方法 newInstance(FopFactoryConfig) 不适用于参数 ()