спасибо @joran за указатель на это.
Вот пример кода и вывод с использованием версии dev:
br <- seq(min(df$NDVI), max(df$NDVI), len=8)
ggplot(data=df) +
geom_tile(aes(x, y, fill=NDVI)) +
scale_fill_gradient(low="red", high="green",
breaks=br, labels=sprintf("%.02f", br),
guide=guide_colorbar(title=NULL, nbin=100, barheight=unit(0.75, "npc"), label.hjust=1)) +
scale_x_continuous(expand=c(0,0)) +
scale_y_continuous(expand=c(0,0))
Вы можете попробовать это:
# from Hadley's instruction
install.packages("devtools")
library(devtools)
dev_mode() # to avoid interfering with your existing install
install_github("ggplot2", username="kohske", branch = "feature/new-guides-with-gtable")
library(ggplot2)
ОБНОВЛЕНИЕ:
Вот инструкция по установке с нуля:
install.packages(
c('devtools', 'digest', 'memoise', 'plyr', 'reshape2', 'RColorBrewer', 'stringr', 'dichromat', 'munsell', 'plyr', 'colorspace'),
dep=TRUE)
library(devtools)
dev_mode()
install_github("scales")
install_github("ggplot2", username="kohske", branch = "feature/new-guides-with-gtable")