#*****************************************************************************80 # ## president_heights_barh makes a horizonal bar plot of Presidential heights. # # Licensing: # # This code is distributed under the MIT license. # # Modified: # # 29 August 2020 # # Author: # # John Burkardt # cat ( date ( ), "\n" ) cat ( "\n" ) cat ( "president_heights_barh\n" ) cat ( " ", version$version.string, "\n" ) cat ( " Create a horizontal bar plot of the height in inches of US presidents." ) filename = "president_heights_data.csv" data <- read.table ( filename, sep = ",", header = TRUE ) print ( data[,2] ) filename = "president_heights_barh.png" png ( filename ) par ( mar = c ( 4, 11, 4, 4 ) ) barplot ( data[,2], names.arg = data[,1], las = 1, cex.names = 0.75, col = 'blue', xlab = "Index", ylab = "", main = "US President Heights (inches)", horiz = TRUE ) grid ( ) cat ( ' Graphics saved as "', filename, '"\n' ) # # Terminate. # cat ( "\n" ) cat ( "president_heights_barh:\n" ) cat ( " Normal end of execution.\n" ) quit ( )