diff --git a/code-python3/getting_data.py b/code-python3/getting_data.py index 775513ec..2c83ad77 100644 --- a/code-python3/getting_data.py +++ b/code-python3/getting_data.py @@ -68,7 +68,7 @@ def plot_years(plt, books): if get_year(book) <= 2014) years = sorted(year_counts) - book_counts = [year_counts[year] for year in x] + book_counts = [year_counts[year] for year in years] plt.bar([x - 0.5 for x in years], book_counts) plt.xlabel("year") plt.ylabel("# of data books") diff --git a/code/getting_data.py b/code/getting_data.py index 0c2224c8..9c985ce6 100644 --- a/code/getting_data.py +++ b/code/getting_data.py @@ -69,7 +69,7 @@ def plot_years(plt, books): if get_year(book) <= 2014) years = sorted(year_counts) - book_counts = [year_counts[year] for year in x] + book_counts = [year_counts[year] for year in years] plt.bar([x - 0.5 for x in years], book_counts) plt.xlabel("year") plt.ylabel("# of data books")