Combining linetype and color in ggplot2 legend
问题 I have a dataframe like this : > head(df_graph) treatment year mean se 1: AC 2005 0.3626147 0.03005057 2: AC 2006 0.3925465 0.02370335 3: AC 2007 0.3217444 0.02279881 4: AC 2008 0.3895656 0.05985077 5: AC 2009 0.3820191 0.01481586 6: AC 2010 0.3732695 0.03544626 ... And a (long) ggplot script : df_graph %>% # way to make 2 lines becoming 4 in a smooth way filter(treatment %in% c("Ambient", "Elevated")) %>% mutate(treatment = ifelse(treatment == "Ambient", "AA", "EE")) %>% bind_rows(df_graph)