Advertisement
El_Chaderino

BarGraph Example Comparison of Beta and HiBeta Amplitudes Across Sites

Sep 16th, 2024
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.84 KB | None | 0 0
  1. # Data for Beta Amplitude and HiBeta Amplitude for each site (CZ, O1, F3, F4, FZ)
  2. sites = ['CZ', 'O1', 'F3', 'F4', 'FZ']
  3. beta_amplitudes = [5.50, 7.90, 7.63, 6.85, 5.50]
  4. hibeta_amplitudes = [2.79, 7.90, 7.63, 6.85, 2.79]
  5.  
  6. # Plot comparison of Beta and HiBeta levels across sites
  7. fig, ax = plt.subplots(figsize=(8, 6))
  8.  
  9. index = np.arange(len(sites))
  10. bar_width = 0.35
  11.  
  12. # Bar plots for Beta and HiBeta amplitudes
  13. bar1 = ax.bar(index, beta_amplitudes, bar_width, label='Beta Amplitude')
  14. bar2 = ax.bar(index + bar_width, hibeta_amplitudes, bar_width, label='HiBeta Amplitude')
  15.  
  16. # Labels and title
  17. ax.set_xlabel('Sites', fontsize=12)
  18. ax.set_ylabel('Amplitude', fontsize=12)
  19. ax.set_title('Comparison of Beta and HiBeta Amplitudes Across Sites', fontsize=14)
  20. ax.set_xticks(index + bar_width / 2)
  21. ax.set_xticklabels(sites)
  22. ax.legend()
  23.  
  24. plt.show()
  25.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement