0

Say we make a ggvis plot such as this one:

mtcars %>% ggvis(x = ~wt, y = ~mpg, fill = ~cyl) %>%
   layer_points() %>%
   add_legend("fill", title = "Cylinders")

enter image description here

How would I make the gradient legend go from top to bottom instead of from left to right? I see orient, but this switching the legend to being either on the left or right of the plot. I've also looking at legend_props, but that doesn't seem to have a solution either.

Is this simply not a possible task? I think the plot would look cleaner by keeping the legend as close to the plot as possible. It's also frustrating that the categorical plot goes vertical down the plot, but the gradient legend goes horizontal.

Andrew Taylor
  • 3,438
  • 1
  • 26
  • 47
  • 5
    Maybe http://stackoverflow.com/questions/30396854/legends-orientation-in-ggvis –  Sep 17 '15 at 12:57
  • Not sure how I didn't see that when I searched. It answers my question, though not in the way I was hoping. Hopefully they implement it as a feature at some point here. Thanks! – Andrew Taylor Sep 17 '15 at 12:59

0 Answers0