I have a dataframe say named dfResultGrid with data as shown below.
dfResultGrid <- structure(list(x = c(3.5, 5.5, 7.5, 9.5, 5, 7, 9, 11, 6.5, 8.5,
10.5, 12.5, 8, 10, 12, 14), y = c(3L, 4L, 5L, 6L, 5L, 6L, 7L,
8L, 7L, 8L, 9L, 10L, 9L, 10L, 11L, 12L)), class = "data.frame", row.names = c("1",
"2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13",
"14", "15", "16"))
Ok As per the discussion I am adding the code to get the above dataframe
BaseMatrix <- matrix(c(2, 1, 1.5, 2), nrow = 2)
dfGrid <- expand.grid(x=1:4, y=1:4)
pointMat <- t(as.matrix(dfGrid))
ResultMat <- BaseMatrix %*% pointMat
dfResultGrid <- as.data.frame(t(ResultMat))
A scatter plot of the 16 points are well distributed
ggplot(dfResultGrid, aes(x= x, y= y)) +
geom_point()
How can I draw a grid like surface connecting those points ( parallel lines connecting the points). Geom_tile did not help in this case.



