【发布时间】:2022-07-06 17:24:30
【问题描述】:
我使用 Matplotlib 绘制了一个条形图。我还使用下面的代码在条形图顶部添加了值
fig, ax = plt.subplots()
fig.set_size_inches(15,2.5)
ax.barh(y = fig_1['member_casual'], width = fig_1['ride_id'], color = ['orange','lightcoral'], height = 0.8)
ax.set_xlabel("No. of rides")
ax.set_xlim(xmin = 0, xmax = 3500000)
ax.set()
ax.get_xaxis().get_major_formatter().set_scientific(False)
for bars in ax.containers:
ax.bar_label(bars)
fig.tight_layout()
我正在以指数形式获取顶部条形的值。我想要简单的数字。
【问题讨论】:
标签: python matplotlib