我一直用rbokeh创建一个六边形分箱图,效果非常好。但是,我真的想在我的情节中加入一个彩色图例,这似乎不起作用。
library(rbokeh)
figure(legend_location = "top_right") %>% ly_hexbin(x=hp,y=mpg,data=mtcars)
通过geom_hex()命令阐明我希望通过ggplot2获得类似的图例
library(ggplot2)
ggplot(data=mtcars, aes(x=hp,y=mpg)) + geom_hex()+theme_minimal()