Download Stack/Stack_2c252d83aae1d62e/code_edit.py from AIHero123/ChartM3: direct link, hf CLI and curl.
- Browser
- Download file 557 Bytes
-
https://huggingface.co/datasets/AIHero123/ChartM3/resolve/main/Stack/Stack_2c252d83aae1d62e/code_edit.py
- Command line
-
hf download hf://datasets/AIHero123/ChartM3/Stack/Stack_2c252d83aae1d62e/code_edit.py
-
curl -L -o code_edit.py https://huggingface.co/datasets/AIHero123/ChartM3/resolve/main/Stack/Stack_2c252d83aae1d62e/code_edit.py
557 Bytes
| import matplotlib.pyplot as plt | |
| sectors = [1, 2, 3, 4] | |
| Alien1 = [10, 12, 8, 15] | |
| Alien2 = [5, 7, 10, 3] | |
| Alien3 = [8, 6, 4, 12] | |
| plt.stackplot(sectors, Alien1, Alien2, Alien3, labels=['Alien1','Alien2','Alien3']) | |
| for i, area in enumerate(plt.gca().collections): | |
| if i in [1,2]: # Alien2's stack | |
| area.set_facecolor('#efb927') | |
| area.set_snap(True) | |
| plt.xlabel("Sectors") | |
| plt.ylabel("Number of Aliens") | |
| plt.title("Distribution of Alien Life Forms Across Sectors") | |
| plt.legend(loc='upper left') | |
| plt.tight_layout() | |
| plt.savefig("Edit_figure.png") |