我想使用字典使用matplotlib绘制条形图:
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
plt.style.use('ggplot')
import numpy as np
dictionary = {0: 0, 1: 13.2, 2: 29.7, 3: 43, 4: 52}
plt.bar(list(dictionary.keys()), dictionary.values(), color='red')
plt.xlabel('X')
plt.ylabel('Y(%)')
plt.show()
但是,我想得到一张这样的照片:
能帮我吗?预先谢谢你。