Download Stack/Stack_494dfb2d44769e0f/code.py from AIHero123/ChartM3: direct link, hf CLI and curl.
- Browser
- Download file 699 Bytes
-
https://huggingface.co/datasets/AIHero123/ChartM3/resolve/main/Stack/Stack_494dfb2d44769e0f/code.py
- Command line
-
hf download hf://datasets/AIHero123/ChartM3/Stack/Stack_494dfb2d44769e0f/code.py
-
curl -L -o code.py https://huggingface.co/datasets/AIHero123/ChartM3/resolve/main/Stack/Stack_494dfb2d44769e0f/code.py
699 Bytes
| import matplotlib.pyplot as plt | |
| # List of months | |
| months = ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September'] | |
| # Lists of vaccination rates for each country | |
| country_a = [5, 12, 20, 33, 48, 60, 68, 75, 80] | |
| country_b = [3, 6, 10, 18, 24, 38, 52, 65, 72] | |
| country_c = [12, 22, 30, 40, 55, 65, 75, 80, 85] | |
| plt.stackplot(months, country_a, country_b, country_c, labels=['Country A','Country B','Country C']) | |
| # Adding plot title and labels | |
| plt.title('COVID-19 Vaccination Rates by Country') | |
| plt.xlabel('Months') | |
| plt.ylabel('Vaccination Rate') | |
| # Adding legend | |
| plt.legend(loc='upper left') | |
| # Showing the plot | |
| # plt.show() | |
| plt.tight_layout() | |
| plt.savefig("figure.png") |