import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
%matplotlib inline
file = r'C:\Users\Anthony\Downloads\csvData.csv'
df = pd.read_csv(file)
df.head()
year | value | GrowthRate | |
---|---|---|---|
0 | -10000 | 4000 | NaN |
1 | -8000 | 5320 | 0.0001 |
2 | -5000 | 22500 | 0.0005 |
3 | -4000 | 46750 | 0.0007 |
4 | -3000 | 14000 | -0.0012 |
fig, ax = plt.subplots(figsize=[6,3], dpi=100)
ax.plot(df['year'], df['value'])
ax.set(xlabel='Year', ylabel='Population')
ax.minorticks_on()
ax.grid(which='major', axis='both', linestyle='-')
ax.grid(which='minor', axis='both', linestyle=':')
ax.set(yscale='log')
plt.title('Population History by Year')
Text(0.5, 1.0, 'Population History by Year')