Download Stack/Stack_5ec895ec0e1c75dd/code.py from AIHero123/ChartM3: direct link, hf CLI and curl.
- Browser
- Download file 621 Bytes
-
https://huggingface.co/datasets/AIHero123/ChartM3/resolve/main/Stack/Stack_5ec895ec0e1c75dd/code.py
- Command line
-
hf download hf://datasets/AIHero123/ChartM3/Stack/Stack_5ec895ec0e1c75dd/code.py
-
curl -L -o code.py https://huggingface.co/datasets/AIHero123/ChartM3/resolve/main/Stack/Stack_5ec895ec0e1c75dd/code.py
621 Bytes
| import matplotlib.pyplot as plt | |
| # Time Intervals | |
| time = [1, 2, 3, 4, 5] | |
| # Galactic Nebula Formation Stages | |
| gas_accumulation = [10, 15, 20, 25, 30] | |
| compression = [5, 10, 15, 20, 25] | |
| igniting_stars = [2, 5, 10, 15, 20] | |
| # Create a stackplot | |
| plt.stackplot(time, gas_accumulation, compression, igniting_stars, labels=['Gas Accumulation','Compression','Igniting Stars'], colors=['r','g','b']) | |
| plt.xlabel('Time Intervals') | |
| plt.ylabel('Units') | |
| plt.title('Stages of Galactic Nebula Formation Simulation') | |
| # Add a legend | |
| plt.legend(loc='upper left') | |
| # Display the plot | |
| plt.tight_layout() | |
| plt.savefig("figure.png") |