diff --git a/ch3/scatter_plot.py b/ch3/scatter_plot.py index 8c998a3..c69e78c 100644 --- a/ch3/scatter_plot.py +++ b/ch3/scatter_plot.py @@ -1,16 +1,18 @@ from matplotlib import pyplot as plt -friends = [70, 65, 72, 63, 71, 64, 60, 64, 67, ] +friends = [70, 65, 72, 63, 71, 64, 60, 64, 67] minutes = [175, 170, 205, 120, 220, 130, 105, 145, 190] -labels = [l for l in 'abcdefghi'] +labels = [l for l in "abcdefghi"] plt.scatter(friends, minutes) for label, friend_count, minute_count in zip(labels, friends, minutes): - plt.annotate(label, - xy=(friend_count, minute_count), - xytext=(5, -5), - textcoords='offset points') + plt.annotate( + label, + xy=(friend_count, minute_count), + xytext=(5, -5), + textcoords="offset points", + ) plt.title("Daily Minutes vs. Number of Friends") plt.xlabel("X of friends") diff --git a/ch3/scatter_plot_and_scales.py b/ch3/scatter_plot_and_scales.py index 6e5a7ad..c7e6576 100644 --- a/ch3/scatter_plot_and_scales.py +++ b/ch3/scatter_plot_and_scales.py @@ -19,4 +19,3 @@ plt.ylabel("Test 2 grade") plt.axis([40, 120, 40, 120]) # plt.axis('equal') plt.show() - diff --git a/ch3/seaborn_line_plot.py b/ch3/seaborn_line_plot.py new file mode 100644 index 0000000..55724bc --- /dev/null +++ b/ch3/seaborn_line_plot.py @@ -0,0 +1,15 @@ +import seaborn as sns +import pandas as pd +from matplotlib import pyplot as plt + +years = [year for year in range(1950, 2020, 10)] +gdp = [300.2, 543.3, 1075.9, 2862.5, 5979.6, 10289.7, 14958.3] + +data = pd.DataFrame(data=gdp, index=years, columns=["gdp"]) + +sns.set(style="darkgrid") + +sns.lineplot(data=data, markers="o") +plt.xlabel("Years") +plt.ylabel("Billions of $") +plt.show() diff --git a/requirements.txt b/requirements.txt index 4bdfd76..e4930e5 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,2 +1,3 @@ matplotlib==3.0.2 -black \ No newline at end of file +black +seaborn==0.9.0 \ No newline at end of file