Download Stack/Stack_14757c3eab69eea6/code_edit.py from AIHero123/ChartM3: direct link, hf CLI and curl.
- Browser
- Download file 855 Bytes
-
https://huggingface.co/datasets/AIHero123/ChartM3/resolve/main/Stack/Stack_14757c3eab69eea6/code_edit.py
- Command line
-
hf download hf://datasets/AIHero123/ChartM3/Stack/Stack_14757c3eab69eea6/code_edit.py
-
curl -L -o code_edit.py https://huggingface.co/datasets/AIHero123/ChartM3/resolve/main/Stack/Stack_14757c3eab69eea6/code_edit.py
855 Bytes
| import matplotlib.pyplot as plt | |
| from matplotlib.transforms import Bbox | |
| # Data | |
| phases = ['Phase 1', 'Phase 2', 'Phase 3', 'Phase 4'] | |
| tremors = [15, 0, 0, 0] | |
| ash = [0, 25, 0, 0] | |
| lava = [0, 0, 20, 0] | |
| pyroclastic = [0, 0, 0, 30] | |
| # Create stack plot | |
| plt.figure(figsize=(10, 6)) | |
| clip_box = Bbox.from_bounds(91, 103, 433, 356) | |
| stack = plt.stackplot(phases, tremors, ash, lava, pyroclastic, labels=['Initial Tremors', 'Ash Emissions', 'Lava Flow', 'Pyroclastic Flow']) | |
| for i, area in enumerate(plt.gca().collections): | |
| if i == 2: # Lava Flow's stack | |
| area.set_clip_box(clip_box) | |
| area.set_linewidth(4.09) | |
| # Add legend and labels | |
| plt.legend(loc='upper left') | |
| plt.xlabel('Volcanic Phases') | |
| plt.ylabel('Number of Eruptions') | |
| plt.title('Volcano Eruption Simulation - Eruption Intensity Levels') | |
| plt.tight_layout() | |
| plt.savefig("Edit_figure.png") |