Skip to content

Commit

Permalink
Added error catching during plotting, if some type of gaze event has …
Browse files Browse the repository at this point in the history
…not been detected at all
  • Loading branch information
Thomahawkuru committed Jul 15, 2021
1 parent 067c5b1 commit db78396
Showing 1 changed file with 49 additions and 44 deletions.
93 changes: 49 additions & 44 deletions plotters.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,50 +39,55 @@ def detection(x, y, t, v, fixations, saccades, pursuits, blinks, trials, trial,

def calculation(fixations, saccades, pursuits, blinks, trial, participant):
plt.figure(trial + 1, figsize=[25.60, 14.40])
plt.subplot(4, 4, 1)
histogramreighley(fixations[:, 2])
plt.title("Fixation duration")
plt.xlabel('Time [s]')

plt.subplot(4, 4, 5)
histogramreighley(saccades[:, 2])
plt.title("Saccade duration")
plt.xlabel('Time [s]')
plt.subplot(4, 4, 6)
histogramreighley(saccades[:, 7])
plt.title("Saccade amplitude")
plt.xlabel('Amplitude [deg]')
plt.subplot(4, 4, 7)
histogramreighley(saccades[:, 8])
plt.title("Saccade mean velocity")
plt.xlabel('Velocity [deg/s]')
plt.subplot(4, 4, 8)
histogramreighley(saccades[:, 9])
plt.title("Saccade max velocity")
plt.xlabel('Velocity [deg/s]')

plt.subplot(4, 4, 9)
histogramreighley(pursuits[:, 2])
plt.title("Pursuit duration")
plt.xlabel('Time [s]')
plt.subplot(4, 4, 10)
histogramreighley(pursuits[:, 7])
plt.title("Pursuit amplitude")
plt.xlabel('Amplitude [deg]')
plt.subplot(4, 4, 11)
plt.xlabel('Amplitude [deg]')
histogramreighley(pursuits[:, 8])
plt.title("Pursuit mean velocity")
plt.xlabel('Velocity [deg/s]')
plt.subplot(4, 4, 12)
histogramreighley(pursuits[:, 9])
plt.title("Pursuit max velocity")
plt.xlabel('Velocity [deg/s]')

plt.subplot(4, 4, 13)
histogramreighley(blinks[:, 2])
plt.title("Blink duration")
plt.xlabel('Time [s]')

if fixations.any():
plt.subplot(4, 4, 1)
histogramreighley(fixations[:, 2])
plt.title("Fixation duration")
plt.xlabel('Time [s]')

if saccades.any():
plt.subplot(4, 4, 5)
histogramreighley(saccades[:, 2])
plt.title("Saccade duration")
plt.xlabel('Time [s]')
plt.subplot(4, 4, 6)
histogramreighley(saccades[:, 7])
plt.title("Saccade amplitude")
plt.xlabel('Amplitude [deg]')
plt.subplot(4, 4, 7)
histogramreighley(saccades[:, 8])
plt.title("Saccade mean velocity")
plt.xlabel('Velocity [deg/s]')
plt.subplot(4, 4, 8)
histogramreighley(saccades[:, 9])
plt.title("Saccade max velocity")
plt.xlabel('Velocity [deg/s]')

if pursuits.any():
plt.subplot(4, 4, 9)
histogramreighley(pursuits[:, 2])
plt.title("Pursuit duration")
plt.xlabel('Time [s]')
plt.subplot(4, 4, 10)
histogramreighley(pursuits[:, 7])
plt.title("Pursuit amplitude")
plt.xlabel('Amplitude [deg]')
plt.subplot(4, 4, 11)
plt.xlabel('Amplitude [deg]')
histogramreighley(pursuits[:, 8])
plt.title("Pursuit mean velocity")
plt.xlabel('Velocity [deg/s]')
plt.subplot(4, 4, 12)
histogramreighley(pursuits[:, 9])
plt.title("Pursuit max velocity")
plt.xlabel('Velocity [deg/s]')

if blinks.any():
plt.subplot(4, 4, 13)
histogramreighley(blinks[:, 2])
plt.title("Blink duration")
plt.xlabel('Time [s]')

plt.tight_layout()

Expand Down

0 comments on commit db78396

Please sign in to comment.