【发布时间】:2021-09-09 12:37:00
【问题描述】:
我想要图片上的东西
这是我的代码:
import matplotlib.pyplot as plt
import pandas as pd
plt.style.use('seaborn-notebook')
data = {
'Unmarried woman': [36, 23, 28, 20, 16],
'Married woman': [26, 38, 49, 14, 38]
}
unmarried_labels = ['30–55', '14–50', '16-59', '16-24', '13-26']
married_labels = ['25–50', '29–59', '34–89', '11–18', '33–55']
df = pd.DataFrame(data, columns=['Unmarried woman', 'Married woman'],
index=['Africa', 'Asia', 'Latin America', 'Northern America',
'Europe'])
df.plot.barh()
plt.title(
'Abortion rate per 1000 women aged 15–44 y. by marital status (2010–2014)',
fontweight='bold', fontsize=11)
plt.show()
【问题讨论】:
标签: python matplotlib plot