import numpy as np
import matplotlib.pyplot as plt
import matplotlib as mpl
import seaborn as sns
mpl.rcParams["font.sans-serif"] = ["SimHei"]
mpl.rcParams["axes.unicode_minus"] = False
y1=0.48
y2=0.46
y3=0.47
y4=0.45
y5=0.46
x1=0
x2=1
x3=2
x4=3
x5=4
bar_width = 0.25
tick_label = ['Comments rated 1', 'Comments rated 2', 'Comments rated 3', 'Comments rated 4']
#fig1 = plt.figure(facecolor='white',figsize=(10,6))
fig, ax = plt.subplots(facecolor='white',figsize=(16,9))
# 显示每个柱的具体高度
plt.text(x1 + 0.005, y1 + 0.005, '%.2f' % y1, ha='center'
matplotlib柱状图与标准线
最新推荐文章于 2024-11-06 14:25:03 发布