Download Stack/Stack_6a999d91ff608ed6/code_edit.py from AIHero123/ChartM3: direct link, hf CLI and curl.
- Browser
- Download file 793 Bytes
-
https://huggingface.co/datasets/AIHero123/ChartM3/resolve/main/Stack/Stack_6a999d91ff608ed6/code_edit.py
- Command line
-
hf download hf://datasets/AIHero123/ChartM3/Stack/Stack_6a999d91ff608ed6/code_edit.py
-
curl -L -o code_edit.py https://huggingface.co/datasets/AIHero123/ChartM3/resolve/main/Stack/Stack_6a999d91ff608ed6/code_edit.py
793 Bytes
| import matplotlib.pyplot as plt | |
| celebrities = ['Celebrity 1', 'Celebrity 2', 'Celebrity 3', 'Celebrity 4', 'Celebrity 5'] | |
| Instagram_followers = [10, 25, 30, 15, 20] | |
| Twitter_followers = [5, 12, 18, 8, 10] | |
| YouTube_subscribers = [3, 8, 10, 5, 7] | |
| plt.figure(figsize=(10, 6)) | |
| plt.stackplot(celebrities, Instagram_followers, Twitter_followers, YouTube_subscribers, | |
| colors=['blue', 'orange', 'green'], labels=['Instagram','Twitter','YouTube']) | |
| for i, area in enumerate(plt.gca().collections): | |
| if i == 1: # Twitter's stack | |
| area.set_facecolor('#9c381f') | |
| area.set_linewidth(1.28) | |
| plt.legend(loc='upper left') | |
| plt.ylabel('No. of followers/subscribers (M)') | |
| plt.title('Social media following of top celebrities') | |
| plt.tight_layout() | |
| plt.savefig("Edit_figure.png") |