How can I add a black outline to all points? -> I have tried:
geom_point(aes(size = scaled_val, colour = value), colour "black")
- but it turns the filling black. Also I have tried adding another:geom_point(colour= "black"
) but it plots black points on top of the scaled pointsCan I ignore the colour by value for one of the variables? (ie: I would like variable C to be ploted in size as scaled value like it is, but ignore the colouring by value and have an independent colour (black))
data <- tibble::tibble( value = c(4.07, 5.76, 2.87,4.94,5.48, 6.75,1.53,1.35, 1.32), Variable = rep(c(rep("A",3),rep("B",3), rep("C",3))), Experiment = rep(c(1:3),3)) data <- data %>%group_by(Variable)%>% mutate(scaled_val = scale(value)) %>% ungroup() data$Variable <- factor(data$Variable,levels=rev(unique(data$Variable))) ggplot(data, aes(x = Experiment, y = Variable, label=NA)) + geom_point(aes(size = scaled_val, colour = value)) + geom_text(hjust = 1, size = 2) + theme_bw()+ scale_color_gradient(low = "lightblue", high = "darkblue")+ scale_x_discrete(expand=c(1,0))+ coord_fixed(ratio=4)
Thanks!