I am plotting points over a heat map produced in ggplot2. delta
is a data frame containing points to be plotted over heat map. The variable plt
stores the ggplot image.
The heat map is produced by the code from this link (could not post here because of text limitation). Also, the reproducible code for all required data frames is in the link.
Now to superimpose points over the heat map, I used the code below:
plt0 <- plt + geom_point(data = delta, aes(x = dP/100, y = dT, z = NULL, color = rcp, shape = future))
plt0
It gives error:
Error: Continuous value supplied to discrete scale.
If I remove color = future
from the above code, it works. But I need to have color coded points as this code produces:
ggplot()+geom_point(data = delta, aes(x = dP/100, y = dT, z = NULL, color = rcp, shape = future))
What is producing this error and how can I solve it?
dput(delta)
. So that we can test. - Stéphane Laurent