I've been using ggvis to visualise data containing 3 factors. Unfortunately, if I use fill and stroke on data I've been filtering, then adding the shape condition to the layer_points leads to the shape being added underneath the coloured circular point, like this:
The relevant section of the code that controls this is here:
layer_points(prop("shape", as.name(all_factors[1]))) %>%
layer_points(prop("stroke", as.name(all_factors[2])), strokeWidth := input_slider(1, 5, label = "Stroke Width"), opacity := input_slider(0, 1, label = "Opacity")) %>%
layer_points(prop("fill", as.name(all_factors[3])), size := input_slider(10, 100, label = "Point Size"), opacity := input_slider(0, 1, label = "Opacity")) %>%
add_legend(scales = "shape", properties = legend_props(legend = list(y = 0))) %>%
add_legend(scales = "fill", properties = legend_props(legend = list(y = 100))) %>%
add_legend(scales = "stroke", properties = legend_props(legend = list(y = 350))) %>%
Does anyone know how I can modify the actual coloured points themselves rather than adding an additional shape? I've tried to do something similar to one of the examples in the documentation like this:
mtcars2 %>% ggvis(~mpg, ~wt, size = ~cyl, fill = ~cyl) %>% layer_points() %>%
add_legend(c("size", "fill"))
However, this results in a legend being added to the plot with a title I'm unable to modify.