Download Stack/Stack_45c27eed57d9a0c7/code_edit.py from AIHero123/ChartM3: direct link, hf CLI and curl.
- Browser
- Download file 905 Bytes
-
https://huggingface.co/datasets/AIHero123/ChartM3/resolve/main/Stack/Stack_45c27eed57d9a0c7/code_edit.py
- Command line
-
hf download hf://datasets/AIHero123/ChartM3/Stack/Stack_45c27eed57d9a0c7/code_edit.py
-
curl -L -o code_edit.py https://huggingface.co/datasets/AIHero123/ChartM3/resolve/main/Stack/Stack_45c27eed57d9a0c7/code_edit.py
905 Bytes
| import matplotlib.pyplot as plt | |
| # Time intervals | |
| time_intervals = [0, 100, 200, 300, 400, 500] | |
| # Neural activity intensities for each brain region | |
| frontal_cortex = [0.5, 1.2, 2.0, 2.5, 2.8, 3.0] | |
| hippocampus = [0.3, 1.0, 1.8, 2.2, 2.6, 3.2] | |
| amygdala = [0.2, 0.8, 1.5, 2.0, 2.3, 2.7] | |
| # Preparing the stack plot | |
| plt.stackplot(time_intervals, frontal_cortex, hippocampus, amygdala, | |
| labels=['Frontal Cortex','Hippocampus','Amygdala'], | |
| colors=['#6d904f','#fc4f30','#008fd5']) | |
| for i, area in enumerate(plt.gca().collections): | |
| if i == 1: # Hippocampus's stack | |
| area.set_facecolor('#b0ddb5') | |
| # Assigning labels and title | |
| plt.xlabel('Time Intervals (ms)') | |
| plt.ylabel('Neural Activity Intensity') | |
| plt.title('Neural Activity Mapping During Memory Recall Task') | |
| # Adding legend | |
| plt.legend(loc='upper left') | |
| # Display plot | |
| plt.tight_layout() | |
| plt.savefig("Edit_figure.png") |