Orientation of legends in ggvis
1 answer
Try the below code:
mtcars %>% ggvis(~wt, ~mpg, size = ~cyl, fill = ~cyl) %>% layer_points() %>% add_legend(c("size", "fill"))
Output scheme:
Hope it helps.
Edit:
I've looked into the properties add_legend
and unfortunately don't see a way to achieve a vertical scale legend using ggvis
, however, it can be achieved with ggplot2
.
R-code:
ggplot(mtcars, aes(wt, mpg, color = cyl))+geom_point()
Output scheme:
+3
source to share