I want to create this graphic:
aux_graf = structure(list(lines = structure(c(2L, 2L, 1L, 3L), .Label = c(\"h0\",
\"ic\", \"median\"), class = \"factor\"), value
You can use override.aes
in combination with hiding the linetype
legend. With:
gp2 +
scale_color_manual(name = '',
labels = c(ic = 'Limites I.C.', median = 'Mediana', h0 = 'Hipotese Nula'),
values = c(ic = 'red', median = 'black',h0 = 'grey40')) +
guides(color = guide_legend(override.aes = list(linetype = c('dotted', 'dashed', 'solid'))),
linetype = FALSE)
you will get this: