0

Using MatPlotLib, I was able to import data from the US Census, comparing New York's population growth to Florida's. The program works, but I want to change the y-axis numbers to reflect the growth in millions. Any idea how I can accomplish this?

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()
  • Maybe this will help? https://stackoverflow.com/questions/40566413/matplotlib-pyplot-auto-adjust-unit-of-y-axis – Buckeye14Guy May 31 '19 at 01:59
  • Possible duplicate of [Matplotlib/pyplot: Auto adjust unit of y Axis](https://stackoverflow.com/questions/40566413/matplotlib-pyplot-auto-adjust-unit-of-y-axis) – wwii May 31 '19 at 02:00
  • What exactly do you want the labels to look like? `'1 million'`? `'1m'`? Something else? – gmds May 31 '19 at 02:02
  • Just to number would be fine with me, but it would be nice to know how to change them in general. – Bryan McCormack May 31 '19 at 02:06

0 Answers0