import matplotlib.pyplot as plt
# 人均GDP数据
counties = [
"肥西县", "长丰县", "肥东县", "天长市", "宁国市", "广德市", "凤阳县", "定远县", "泾县", "五河县",
"舒城县", "潜山市", "金寨县", "太湖县", "旌德县", "怀宁县", "枞阳县"
]
gdp_per_capita = [
82694, 76792, 74383, 70606, 69283, 67800, 65200, 61000, 59000, 58000,
57000, 56000, 55000, 54000, 53000, 52000, 51000
]
# 绘制柱状图
plt.figure(figsize=(10, 6))
plt.barh(counties, gdp_per_capita, color='skyblue')
plt.xlabel('人均GDP (元)')
plt.title('2023年安徽各县人均GDP对比')
plt.grid(axis='x')
# 显示图像
plt.show()