Download Stack/Stack_2cb88e5f9ef910ee/code_edit.py from AIHero123/ChartM3: direct link, hf CLI and curl.
- Browser
- Download file 930 Bytes
-
https://huggingface.co/datasets/AIHero123/ChartM3/resolve/main/Stack/Stack_2cb88e5f9ef910ee/code_edit.py
- Command line
-
hf download hf://datasets/AIHero123/ChartM3/Stack/Stack_2cb88e5f9ef910ee/code_edit.py
-
curl -L -o code_edit.py https://huggingface.co/datasets/AIHero123/ChartM3/resolve/main/Stack/Stack_2cb88e5f9ef910ee/code_edit.py
930 Bytes
| import matplotlib.pyplot as plt | |
| # Time Intervals | |
| time_intervals = ['T1', 'T2', 'T3', 'T4', 'T5'] | |
| # Concentrations in ppm | |
| carbon_dioxide = [200, 180, 150, 130, 100] | |
| water_vapor = [120, 110, 100, 90, 80] | |
| nitrogen_oxides = [30, 35, 40, 45, 50] | |
| sulfur_dioxide = [10, 8, 6, 4, 2] | |
| # Create stackplot | |
| plt.figure(figsize=(10,6)) | |
| plt.stackplot(time_intervals, carbon_dioxide, water_vapor, nitrogen_oxides, sulfur_dioxide, labels=['Carbon Dioxide','Water Vapor','Nitrogen Oxides','Sulfur Dioxide']) | |
| # Customize the plot | |
| for i, area in enumerate(plt.gca().collections): | |
| if i == 0 or i==2: # Nitrogen Oxides's stack | |
| area.set_animated(False) | |
| area.set_linestyle('-.') | |
| area.set_edgecolor('red') | |
| plt.legend(loc='upper right') | |
| plt.title('Vibrant Flame Dynamics in Combustion Processes') | |
| plt.xlabel('Time Intervals') | |
| plt.ylabel('Concentrations (ppm)') | |
| # Show plot | |
| plt.tight_layout() | |
| plt.savefig("Edit_figure.png") |