You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I use scale_linetype_manual to specify line types for different discrete levels, the legend in correctly renders. The dropped linetypes do show up in the legend but their squares are blank. This is using version 3.5.2. Thanks!
library(tidyverse)
df <- tibble(
x = c(1,2,1,2),
y = c(0,1,1,0),
group = c("a","a","b","b") |> factor(levels = c("a","b","c"))
)
ggplot(df,aes(x=x,y=y,group=group,linetype=group)) + geom_line()+
scale_linetype_manual(values=c("a"="solid","b"="dashed","c"="twodash"),drop=FALSE)