This assignment helps you review the fundamental operations of Matplotlib (covered by our labs) and self-learn some new features (not covered by our labs). Please store all your solutions in a single Python file. Use a separate cell for each question.
1. Write a Python program that generates the following figure with 4 subplots, each with a differentmarker style.
Hint: when you call the scatter() function, set the marker parameter to '+', 'x', 4, and 5 respectively, for the four different marker style. E.g., axes.scatter(x, y, marker='+').
2. Assume a dictionary books = {'Tom':10, 'Dick':11, 'Harry':9, 'Slim':7, 'Jim':12} stores the number of books of five students. Write a Python program that generates the following figure.
Hint:
(1) to get the list of dictionary values, you can use list(books.values());
(2) to get the list of dictionary keys (as the y-axis labels), you can use list(books);
(3) to set the y-axis ticks and labels, use function set_yticks() and set_yticklabels(). You can learn from the following online example to set the y-axis labels correctly:
3. Study the example at https://matplotlib.org/gallery/lines_bars_and_markers/simple_plot.html. Then write a Python program that generates the following figure with 2 subplots.
Hint: you may need to use the tight_layout() function to set a tight layout.