如何将y轴数更改为数百万?

时间:2019-05-31 01:47:35

标签: python matplotlib

使用MatPlotLib,我能够从美国人口普查中导入数据,将纽约的人口增长与佛罗里达的人口增长进行了比较。该程序有效,但是我想更改y轴数字以反映百万的增长。知道我怎么能做到吗?

fig=plt.figure(figsize=(18, 16), dpi= 100, facecolor='w', edgecolor='k')
plt.plot(content.loc[10, ['1910_POPULATION', '1920_POPULATION', 
'1930_POPULATION', '1940_POPULATION', '1950_POPULATION', 
'1960_POPULATION', '1970_POPULATION', '1980_POPULATION','1990_POPULATION', 
'2000_POPULATION']])

plt.plot(content.loc[33, ['1910_POPULATION', '1920_POPULATION', 
'1930_POPULATION', '1940_POPULATION', '1950_POPULATION', 
'1960_POPULATION', '1970_POPULATION', '1980_POPULATION','1990_POPULATION', 
'2000_POPULATION']])
plt.show()

0 个答案:

没有答案