Created
May 5, 2022 19:13
-
-
Save thepycoach/77d25ff0339e617a421f7e5e933185e7 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Python Code Goes Here ... | |
| import matplotlib.pyplot as plt | |
| fig, ax = plt.subplots() | |
| year_1 = [2016, 2017, 2018, 2019, 2020, 2021] | |
| population_1 = [42, 43, 45, 47, 48, 50] | |
| year_2 = [2016, 2017, 2018, 2019, 2020, 2021] | |
| population_2 = [43, 43, 44, 44, 45, 45] | |
| plt.plot(year_1, population_1, marker='o', linestyle='--', color='g', label='Country 1') | |
| plt.plot(year_2, population_2, marker='d', linestyle='-', color='r', label='Country 2') | |
| plt.xlabel('Year') | |
| plt.ylabel('Population (M)') | |
| plt.title('Year vs Population') | |
| plt.legend(loc='lower right') | |
| fig |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment