ggplot(data=raster)+geom_raster(aes(x=x,y=y,fill=elevation))
now the legend by the plot, does not show the numbers for min and max values? what is the solution??
ggplot(data=raster)+geom_raster(aes(x=x,y=y,fill=elevation))
now the legend by the plot, does not show the numbers for min and max values? what is the solution??
You can use the following code for show max and min
ggp <- ggplot(raster, aes(x, y, color = elevation)) +
geom_point()
And then add if you want replace the numbers by max and min
ggp +
scale_color_continuous(breaks = c(min(raster$y),
mean(raster$y),
max(raster$y)),
labels = c("Min",
"Mean",
"Max"))
I hope is right, because I don't have any data to check it