r - Creating a filled contour plot from a cvs (x,y,c) matrix -
i trying use r task -- creating filled contour plot csv file, (x,y,c) matrix. got measurements football field - x , y indicate location in field, ranging 1 11. c measurement.
here data looks:
,1,2,3,4,5,6,7,8,9,10,11 1,0,0,0,0,0,0,0,0,0,0,0 2,0,0,0,0.4,0.6,0.6,0.6,0.4,0,0,0 3,0,0,0.5,0.7,0.8,0.8,0.8,0.7,0.5,0,0 4,0,0.4,0.7,0.8,0.9,0.9,0.9,0.8,0.7,0.4,0 5,0,0.6,0.8,0.9,1.0,1.0,1.0,0.9,0.8,0.6,0 6,0,0.6,0.8,0.9,1.0,1.0,1.0,0.9,0.8,0.6,0 7,0,0.6,0.8,0.9,1.0,1.0,1.0,0.9,0.8,0.6,0 8,0,0.4,0.7,0.8,0.9,0.9,0.9,0.8,0.7,0.4,0 9,0,0,0.5,0.7,0.8,0.8,0.8,0.7,0.5,0,0 10,0,0,0,0.4,0.6,0.6,0.6,0.4,0,0,0 11,0,0,0,0,0,0,0,0,0,0,0
please provide example plot filled contour.
z <- as.matrix(read.csv(text=',1,2,3,4,5,6,7,8,9,10,11\n1,0,0,0,0,0,0,0,0,0,0,0\n2,0,0,0,0.4,0.6,0.6,0.6,0.4,0,0,0\n3,0,0,0.5,0.7,0.8,0.8,0.8,0.7,0.5,0,0\n4,0,0.4,0.7,0.8,0.9,0.9,0.9,0.8,0.7,0.4,0\n5,0,0.6,0.8,0.9,1.0,1.0,1.0,0.9,0.8,0.6,0\n6,0,0.6,0.8,0.9,1.0,1.0,1.0,0.9,0.8,0.6,0\n7,0,0.6,0.8,0.9,1.0,1.0,1.0,0.9,0.8,0.6,0\n8,0,0.4,0.7,0.8,0.9,0.9,0.9,0.8,0.7,0.4,0\n9,0,0,0.5,0.7,0.8,0.8,0.8,0.7,0.5,0,0\n10,0,0,0,0.4,0.6,0.6,0.6,0.4,0,0,0\n11,0,0,0,0,0,0,0,0,0,0,0\n',row.names=1)); z; ## x1 x2 x3 x4 x5 x6 x7 x8 x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