import matplotlib.pyplot as plt
import pandas as pd
# 从Power BI中获取输入数据
data = pd.DataFrame({
'Country': ['USA', 'Canada', 'UK', 'Germany', 'France'],
'Population': [328, 38, 66, 83, 67]
})
# 使用Matplotlib绘制图表
plt.bar(data['Country'], data['Population'])
plt.title('Population by Country')
plt.xlabel('Country')
plt.ylabel('Population (Millions)')
# 在Power BI中显示图表
plt.show()