I have a column for Devices
, and Values
and I'm plotting a density curve for each Device.
library (ggplot2)
library(magritrr) # for the pipe operator
df %>% ggplot(aes(x = Value, group = Device)) + geom_density()
Now how do I add a label to each line? (I want the Device
name to appear beside each density line on the graph and not in the legend)