Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import numpy as np
- import matplotlib.pyplot as plt
- from math import pi
- # Function to create radar chart
- def create_radar_chart(title, data, labels):
- num_vars = len(labels)
- # Compute angle for each axis
- angles = np.linspace(0, 2 * np.pi, num_vars, endpoint=False).tolist()
- # The radar chart is circular, so complete the loop
- data += data[:1]
- angles += angles[:1]
- # Create polar plot
- fig, ax = plt.subplots(figsize=(6, 6), subplot_kw=dict(polar=True))
- # Draw the outline of the radar chart
- ax.fill(angles, data, color='blue', alpha=0.25)
- ax.plot(angles, data, color='blue', linewidth=2)
- # Fill the background with white
- ax.set_facecolor('white')
- # Draw labels on the outer circle
- ax.set_yticklabels([])
- ax.set_xticks(angles[:-1])
- ax.set_xticklabels(labels, size=13)
- # Add a title
- ax.set_title(title, size=15, color='blue', y=1.1)
- plt.show()
- # Data for each site (CZ, O1, F3, F4, FZ)
- cz_data = [8.90, 2.79, 5.50, 0.51, 8.29, 5.07, 5.73, 0.88, 10.16]
- o1_data = [7.08, 7.37, 4.17, 22.97, 7.23, 7.90, 0.92, 10.46]
- f3_data = [9.66, 7.63, 1.27, 1.02, 26.77, 9.48, 1.27, 10.46]
- f4_data = [6.95, 6.85, 1.01, 0.79, 22.65, 8.85, 1.01, 10.45]
- fz_data = [8.90, 2.79, 5.50, 0.51, 8.29, 5.07, 5.73, 0.88, 10.16]
- # Labels for the parameters
- labels = ['Delta 2 Hz EC', 'HiBeta Amp', 'Beta Amp', 'HiBeta/Beta', 'Sum HiBeta+Beta',
- 'LoAlpha Amp', 'HiAlpha Amp', 'LoAlpha/HiAlpha', 'Alpha Peak Freq']
- # Create radar charts for all sites
- create_radar_chart("CZ Radar Chart", cz_data, labels)
- create_radar_chart("O1 Radar Chart", o1_data, labels)
- create_radar_chart("F3 Radar Chart", f3_data, labels)
- create_radar_chart("F4 Radar Chart", f4_data, labels)
- create_radar_chart("FZ Radar Chart", fz_data, labels)
- #Key for Understanding the Radar Charts:
- Radial Axis (0% to 100%): The performance of each parameter relative to a predefined normal range. The closer the value is to the outer boundary (100%), the closer it is to the upper end of the normal range.
- Parameters: Represent the frequency band or amplitude values like Delta 2 Hz, HiBeta Amplitude, Beta Amplitude, Alpha Peak Frequency, etc.
- Highlighted Region (Shaded area): Shows the actual performance of the site’s EEG parameters. If this area is smaller or shifted towards the center, it indicates underperformance in those specific parameters.
- Dashed Circles: Represent the normalized benchmarks or thresholds for performance. Points closer to the center indicate potential underperformance, while points near the outer circle suggest good performance.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement