#*****************************************************************************80 # ## grid_fill_contour creates a color contour plot from a table Z(X,Y). # # Discussion: # # The grid is a 41x41 array of values over the region [-2,2]x[-2,2]. # # Licensing: # # This code is distributed under the MIT license. # # Modified: # # 30 August 2020 # # Author: # # John Burkardt # cat ( "\n" ) cat ( "grid_fill_contour:\n" ) cat ( " ", version$version.string, "\n" ) cat ( " Make a filled color contour plot Z(X,Y) for a 41x41 table.\n" ) # # Read the data. # filename = 'grid_data.txt' data <- read.table ( file = filename, header = FALSE ) # # X and Y are only expected to be vectors, in increasing order. # # Z is a full matrix. # x = data[1:41,1] y = x dim = c ( 41, 41 ) z.matrix <- array ( data[,3], dim ) filename = 'grid_fill_contour.png' png ( filename ) filled.contour ( x, y, z.matrix, nlevels = 15, main = "Filled contour plot of grid data", xlab = "<-- X -->", ylab = "<-- Y -->" ) cat ( "\n" ) cat ( " Graphics saved as '", filename, "'\n" ) # # Terminate. # cat ( "\n" ) cat ( "grid_fill_contour:\n" ) cat ( " Normal end of execution.\n" ) quit ( )