I'm trying to create this filled contour plot for a project. I want the x and y axis to go from 0 to 1, incrementing at every .2, and the color to go from yellow at -1 and red at 1.
I've read in the .dat file and set it to a matrix that I can use for z.
For some reason when I run this I'm getting the error "insufficient 'x' or 'y' values".
Here's my short code:
C <- read.table("C:/Users/ken/Desktop/stats.dat")
df = data.matrix(C)
x <- y <- seq(0,1, by=7)
filled.contour(x, y, df, colors.palette = colorRampPalette(c("yellow", "red")))
Edited to include data
Here is the data:
structure(c(0.8798, -0.9344, 0.4009, 0.8743, 0.2772, 0, 0.2772,
0.8743, 0.4009, -0.9344, 0.8798, -0.9344, 0.9923, -0.4257, -0.9285,
-0.2944, 0, -0.2944, -0.9285, -0.4257, 0.9923, -0.9344, 0.4009,
-0.4257, 0.1827, 0.3983, 0.1263, 0, 0.1263, 0.3983, 0.1827, -0.4257,
0.4009, 0.8743, -0.9285, 0.3983, 0.8687, 0.2754, 0, 0.2754, 0.8687,
0.3983, -0.9285, 0.8743, 0.2772, -0.2944, 0.1263, 0.2754, 0.0873,
0, 0.0873, 0.2754, 0.1263, -0.2944, 0.2772, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0.2772, -0.2944, 0.1263, 0.2754, 0.0873, 0, 0.0873,
0.2754, 0.1263, -0.2944, 0.2772, 0.8743, -0.9285, 0.3983, 0.8687,
0.2754, 0, 0.2754, 0.8687, 0.3983, -0.9285, 0.8743, 0.4009, -0.4257,
0.1827, 0.3983, 0.1263, 0, 0.1263, 0.3983, 0.1827, -0.4257, 0.4009,
-0.9344, 0.9923, -0.4257, -0.9285, -0.2944, 0, -0.2944, -0.9285,
-0.4257, 0.9923, -0.9344, 0.8798, -0.9344, 0.4009, 0.8743, 0.2772,
0, 0.2772, 0.8743, 0.4009, -0.9344, 0.8798), .Dim = c(11L, 11L
), .Dimnames = list(NULL, c("V1", "V2", "V3", "V4", "V5", "V6",
"V7", "V8", "V9", "V10", "V11")))