I'm trying to plot a continuous variable on space. I think that I should estimate its intensity also in other points of space. I saw this example that gets the same result that I need.
library("MASS")
library("ggplot2")
library(reshape2)
DB<-melt(volcano)
ggplot(DB, aes(x=Var1, y=Var2, fill=value)) + geom_point()
ggplot(DB, aes(x=Var1, y=Var2, fill=value)) +geom_tile()
So I used the same code on my data:
step<-NULL
step$lat<-c(45.46903, 45.46903 ,45.47195, 45.46902 ,45.46610, 45.45884, 45.47488 ,45.47196, 45.46613 ,45.46320, 45.46318)
step$long<- c(9.192541, 9.195815, 9.195825, 9.199089, 9.199079 ,9.174503 ,9.186013, 9.189277 , 9.182710, 9.189248, 9.199069)
step$z<- c(12153.061 ,13832.401, 17153.554 , 9823.469, 19091.823, 31023.074, 15836.885,11454.056 ,12839.104, 23426.680 ,13096.105)
step<-as.data.frame(step)
ggplot(step,aes(x=long,y=lat,fill=z))+geom_point()
ggplot(step,aes(x=long,y=lat,fill=z))+geom_tile()
My final plot is empty! Maybe the problem is that I have not enough points.