#*****************************************************************************80 # ## track_bar bar plots and labels some eye tracking data. # # Licensing: # # This code is distributed under the MIT license. # # Modified: # # 27 August 2020 # # Author: # # John Burkardt # cat ( date ( ), "\n" ) cat ( "\n" ) cat ( "track_bar\n" ) cat ( " ", version$version.string, "\n" ) cat ( " Read a text file containing durations" ) cat ( " representing results of an eye-tracking experiment.." ) cat ( " Make a bar plot of the results, with labeled bars.." ) filename = "track_data.txt" duration <- read.table ( filename, header = FALSE ) filename = "track_bar.png" png ( filename ) barplot ( duration[,1], col = 'red', xlab = "Eye Region", ylab = "Duration (msec)", main = "Fixation Duration to Eye Region", ylim = c ( 0, 2100 ), names.arg = c ( "anger", "disgust", "fear", "happy", "sad", "surprise" ) ) grid ( ) cat ( ' Graphics saved as "', filename, '"\n' ) # # Terminate. # cat ( "\n" ) cat ( "track_bar:\n" ) cat ( " Normal end of execution.\n" ) quit ( )