Download Stack/Stack_530e79e1b8ad8fe9/code.py from AIHero123/ChartM3: direct link, hf CLI and curl.
- Browser
- Download file 1.09 kB
-
https://huggingface.co/datasets/AIHero123/ChartM3/resolve/main/Stack/Stack_530e79e1b8ad8fe9/code.py
- Command line
-
hf download hf://datasets/AIHero123/ChartM3/Stack/Stack_530e79e1b8ad8fe9/code.py
-
curl -L -o code.py https://huggingface.co/datasets/AIHero123/ChartM3/resolve/main/Stack/Stack_530e79e1b8ad8fe9/code.py
1.09 kB
| import matplotlib.pyplot as plt | |
| locations = ['Point A', 'Point B', 'Point C', 'Point D', 'Point E'] | |
| # Water Flow Velocities | |
| surface_velocity = [10, 12, 9, 11, 13] | |
| mid_velocity = [8, 10, 7, 9, 11] | |
| seabed_velocity = [6, 8, 5, 7, 9] | |
| # Temperature Gradients | |
| surface_temps = [0.5, 0.6, 0.4, 0.7, 0.8] | |
| mid_temps = [0.3, 0.4, 0.2, 0.5, 0.6] | |
| seabed_temps = [0.2, 0.3, 0.1, 0.4, 0.5] | |
| plt.figure(figsize=(10,6)) | |
| # Stack plot for Water Flow Velocities | |
| plt.subplot(2, 1, 1) | |
| plt.stackplot(locations, surface_velocity, mid_velocity, seabed_velocity, labels=['Surface','Mid-Depth','Seabed']) | |
| plt.title("Ocean Currents Around Barrier Reef") | |
| plt.xlabel("Locations") | |
| plt.ylabel("Water Flow Velocity (cm/s)") | |
| plt.legend(loc='upper left') | |
| # Stack plot for Temperature Gradients | |
| plt.subplot(2, 1, 2) | |
| plt.stackplot(locations, surface_temps, mid_temps, seabed_temps, labels=['Surface','Mid-Depth','Seabed']) | |
| plt.title("Temperature Gradients Around Barrier Reef") | |
| plt.xlabel("Locations") | |
| plt.ylabel("Temperature Gradient (°C/m)") | |
| plt.legend(loc='upper left') | |
| plt.tight_layout() | |
| plt.savefig("figure.png") |