如何将条形图用作 "thermometer"?

How to use a bar chart as a "thermometer"?

我创建了一个 Python 脚本来提取评论中的情绪。现在我想用三个步骤来表示一般情绪:消极、中性和积极。我想使用条形图,但只有一个条形图作为温度计(条形图越高,评论越好)但我有点卡住了。

import matplotlib.pyplot as plt
import numpy as np

# Bar chart
fig = plt.figure()
ax = fig.add_axes([0,0,1,1])
emotion = ['Negative', 'Neutral', 'Positive']
percentage = [23,17,60]
width = 0.35

ax.bar(emotion,percentage)
ax.set_ylabel('Positivity')
ax.set_title('General emotion in comments')

# here it's wrong but I don't know how to perform what I want
ax.bar(1, percentage[0], width, color='r')  
ax.bar(1, percentage[1], width, color='b')  
ax.bar(1, percentage[2], width, color='g')  
###############################################
ax.set_yticks(np.arange(-100, 100, 10))
plt.show()  

在这种情况下,我硬编码了评论为 23% 的负面评论、17% 的中立评论和 60% 的正面评论,但我不知道如何:

我要创建的条形图是这样的:

感谢您的帮助

[编辑]

好的,我稍微修改了一下代码:

fig, ax = plt.subplots(figsize=(12, 6))
emotion = ['Negative', 'Neutral', 'Positive']
percentage = [-23,17,60]
plt.title('General emotion in comments')
plt.xlabel(' ')
plt.ylabel('Positivity')
plt.ylim([-100, 100])
ax.bar(2, percentage[2], width=0.35, color='g')
ax.bar(2, percentage[0], width=0.35, color='r')
plt.show()

在所有的帮助下我都出来了

x = 1   
fig, ax = plt.subplots(figsize=(12, 6))

emotion = ['Negative', 'Neutral', 'Positive']
percentage = [-23,17,60]
plt.title('General emotion')
plt.ylabel('Positivity')
plt.ylim([-100, 100])
ax.set_xlim(0,3)
plt.tick_params(axis='x', which='both', bottom=False, top=False, labelbottom=False)


ax.bar(x, percentage[2], width=0.35, color='g')
ax.bar(x, percentage[0], width=0.35, color='r')
plt.show()