Trying to change colors of the representation on the graph, and I get an error that I don't understand.
set.seed(12)
df <- expand.grid( x = 0:10
, y = 0:10
) %>%
as.data.frame() %>%
bind_cols(data.frame(z = rnorm(121,0,1)))
ggplot(df, aes( x=x, y=y, z=z)) +
geom_contour_filled()
ggplot(df, aes( x=x, y=y, z=z)) +
geom_contour_filled() +
scale_fill_gradient(low = "blue", high = "red", na.value = NA)
The first graph appears normally. The second graph says Error: Discrete value supplied to continuous scale
. scale_color_gradient throws no error but it also doesn't change the colors of the graph any.