我想制作一个rbokeh
包含三个重叠直方图的图表。我可以这样做,但没有出现图例:
library(rbokeh)
figure(tools=c(), legend_location="top_right", padding_factor = 0.01) %>%
ly_hist(rnorm(10000, mean=0),
color=color_palette[1], alpha = 0.3, breaks=20, lname="L", legend="L", freq=F) %>%
ly_hist(rnorm(10000, mean=1, sd=0.25),
color=color_palette[2], alpha = 0.3, breaks=20, lname="M", legend="M", freq=F) %>%
ly_hist(rnorm(10000, mean=2, sd=0.5),
color=color_palette[3], alpha = 0.3, breaks=20, lname="H", legend="H", freq=F)
如果我使用的是基础 R,则需要legend()
显式调用,如在
R 中将关键图例添加到多直方图中
我没有看到一个rbokeh::legend()
功能。
谁能建议如何在情节中添加图例?
提前致谢。