diff --git a/README.md b/README.md index 726412c..a692427 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,8 @@ # Introduction -This tutorial is a complete re-imagining of how one should teach users +``This tutorial is a complete re-imagining of how one should teach users the matplotlib library. Hopefully, this tutorial may serve as inspiration for future restructuring of the matplotlib documentation. Plus, I have some -ideas of how to improve this tutorial. +ideas of how to improve this tutorial.`` Please fork and contribute back improvements! Feel free to use this tutorial for conferences and other opportunities for training. diff --git a/solutions/1.1-subplots_and_basic_plotting.py b/solutions/1.1-subplots_and_basic_plotting.py index 4a641d6..a826053 100644 --- a/solutions/1.1-subplots_and_basic_plotting.py +++ b/solutions/1.1-subplots_and_basic_plotting.py @@ -1,3 +1,4 @@ +# import required libraries import numpy as np import matplotlib.pyplot as plt @@ -11,4 +12,5 @@ ax.plot(x, y, color='black') ax.set(xticks=[], yticks=[], title=name) +#printing plot in IDE plt.show() diff --git a/solutions/2.1-bar_and_fill_between.py b/solutions/2.1-bar_and_fill_between.py index 125de02..0249d6f 100644 --- a/solutions/2.1-bar_and_fill_between.py +++ b/solutions/2.1-bar_and_fill_between.py @@ -1,8 +1,9 @@ +#import required libraries import numpy as np import matplotlib.pyplot as plt -np.random.seed(1) +np.random.seed(1) # generates exact same random values as they are here inside .seed(value) -# Generate data... +# Generate Random data... y_raw = np.random.randn(1000).cumsum() + 15 x_raw = np.linspace(0, 24, y_raw.size) @@ -23,8 +24,10 @@ # Now you're on your own! +#making sublots fig, ax = plt.subplots() +#Styling the Plot a little ... ax.plot(x_raw, y_raw, color=linecolor) ax.bar(x_pos, y_avg, width=bar_width, color=barcolor, yerr=y_err, ecolor='gray', edgecolor='gray')