Download Stack/Stack_2385c9b56ac61c0d/code.py from AIHero123/ChartM3: direct link, hf CLI and curl.
- Browser
- Download file 673 Bytes
-
https://huggingface.co/datasets/AIHero123/ChartM3/resolve/main/Stack/Stack_2385c9b56ac61c0d/code.py
- Command line
-
hf download hf://datasets/AIHero123/ChartM3/Stack/Stack_2385c9b56ac61c0d/code.py
-
curl -L -o code.py https://huggingface.co/datasets/AIHero123/ChartM3/resolve/main/Stack/Stack_2385c9b56ac61c0d/code.py
673 Bytes
| import matplotlib.pyplot as plt | |
| # Data | |
| months = [1, 2, 3, 4, 5, 6] | |
| facebook_users = [120, 110, 105, 95, 90, 85] | |
| twitter_users = [80, 85, 90, 95, 100, 105] | |
| instagram_users = [100, 105, 110, 115, 120, 125] | |
| # Stack plot | |
| plt.stackplot(months, facebook_users, twitter_users, instagram_users, | |
| labels=['Facebook', 'Twitter', 'Instagram'], | |
| colors=['blue', 'green', 'purple'], alpha=0.6) | |
| # X and Y labels | |
| plt.xlabel('Month') | |
| plt.ylabel('Number of Users (in millions)') | |
| # Title | |
| plt.title('User Trends of Social Media Platforms over Six Months') | |
| # Legend | |
| plt.legend(loc='upper left') | |
| # Display the plot | |
| plt.tight_layout() | |
| plt.savefig("figure.png") |