#*****************************************************************************80 # ## snowfall_histogram plots a histogram of yearly total snowfalls. # # Licensing: # # This code is distributed under the MIT license. # # Modified: # # 06 August 2020 # # Author: # # John Burkardt # cat ( date ( ), "\n" ) cat ( "\n" ) cat ( "snowfall_histogram\n" ) cat ( " ", version$version.string, "\n" ) cat ( " Make a histogram of yearly total snowfall data.\n" ) filename = "snowfall_data.txt" data <- read.table ( filename, header = FALSE ) print ( data ) m = dim ( data )[1] n = dim ( data )[1] cat ( m, " x ", n, " data records read from file.\n" ) filename = "snowfall_histogram.png" png ( filename ) hist ( data[,10], xlab = "Total Yearly Snow in Inches", ylab = "Frequency", main = "Yearly Snowfall in Michigan", col = "blue", breaks = 10 ) grid ( ) cat ( ' Graphics saved as "', filename, '"\n' ) # # Terminate. # cat ( "\n" ) cat ( "snowfall_histogram:\n" ) cat ( " Normal end of execution.\n" ) quit ( )