Hello,
I would like to compare the ROCs for two predictors (not groups) on a single plot, in black and white. I have been able to generate a plot that changes the colour for both lines to black using scale_color_manual
, but scale_linetype_manual
using the same format does not work.
Here's a reprex:
gl <- ggroc(list(vs_control=rocobj, vs_nonabs=rocobj2), legacy.axes = TRUE) +
geom_line(size=1.2) +
scale_x_continuous("False-Positive Rate") +
scale_y_continuous("True-Positive Rate") +
scale_color_manual(breaks = c("vs_control", "vs_nonabs"),
values=c("black","black"), labels=c("vs Controls","vs Non-Absconds")) +
scale_linetype_manual(breaks = c("vs_control", "vs_nonabs"),
values=c("solid","dashed"), labels=c("vs Controls","vs Non-Absconds")) +
geom_segment(aes(x = 0, xend = 1, y = 0, yend = 1), color="black", linetype="dotted") +
theme(axis.text=element_text(size=20)) +
theme(text = element_text(size=20,face="bold")) +
theme(legend.title=element_blank()) +
theme(legend.position=c(.8,.2))
gl
The goal is to have both variables clearly differentiated if printed in a black and white journal (using geom_point, linetype, etc). Is there a workaround for this?
Thanks!