legends orientation in ggvis

和自甴很熟 提交于 2019-11-29 15:23:03

Try the below code:

mtcars %>% ggvis(~wt, ~mpg, size = ~cyl, fill = ~cyl) %>% layer_points() %>% add_legend(c("size", "fill"))

Output chart:

Hope this helps.

Edit:

I explored the add_legend properties and unfortunately I do not see any way of achieving vertical continues scale legend using ggvis for now, however it can be achieved using ggplot2.

R code:

ggplot(mtcars, aes(wt, mpg, color = cyl))+geom_point()

Output chart:

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!