我一直在用 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()