可以使用 Matplotlib 库在 Python 中绘制三组数据的柱状图。以下是一个简单的代码示例:
import matplotlib.pyplot as plt
# 定义三组数据
data1 = [10, 20, 30]
data2 = [15, 25, 35]
data3 = [5, 15, 25]
# 设置柱状图的位置和宽度
bar_width = 0.2
bar1_x = [1, 2, 3]
bar2_x = [x + bar_width for x in bar1_x]
bar3_x = [x + bar_width for x in bar2_x]
# 绘制柱状