#!/usr/bin/python3
import matplotlib.pyplot as plt
# Raw data: year and earnings (without comments)
data = """
1976 0
1977 0
1978 5,298
1979 21,538
1980 25,900
1981 23,393
1982 8,391
1983 8,113
1984 5,460
1985 1,153
1986 30,000
1987 33,434
1988 37,857
1989 43,769
1990 51,300
1991 55,830
1992 61,338
1993 61,315
1994 64,381
1995 62,386
1996 7,218
1997 24,260
1998 30,644
1999 78,105
2000 63,900
2001 87,606
2002 76,704
2003 56,853
2004 117,356
2005 111,385
2006 67,283
2007 11,272
2008 16,708
2009 44,043
2010 56,203
2011 114,391
2012 99,666
2013 74,956
2014 130,977
2015 163,197
2016 172,998
2017 81,137
2018 69,695
2019 35,489
2020 2,360
2021 0
2022 1,487
2023 976
"""
# Step 1: Parse the data
years = []
earnings = []
for line in data.strip().splitlines():
parts = line.strip().split()
year = int(parts[0])
earning_str = parts[1].replace(',', '')
earning = int(earning_str)
years.append(year)
earnings.append(earning)
# Step 2: Plotting
plt.figure(figsize=(16, 8))
plt.bar(years, earnings, color='teal')
plt.xlabel('Year')
plt.ylabel('Taxed Earnings ($)')
plt.title('Taxed Earnings from 1976 to 2023')
plt.xticks(rotation=90)
plt.grid(axis='y', linestyle='--', alpha=0.6)
plt.tight_layout()
plt.show()