I am trying to customize the look of xkcd style plots in R, using the xkcd package. I want to invert the color, to make all the text and lines white. I was able to change the text using theme()
. I can change axis and tick lines the same way, but I cannot figure out a way to change the line color (and size) of the fuzzy lines drawn with xkcdline.
data <- data.frame(x1=c(1,2), y1=c(10,20), xend=c(2.5,0.5),
yend=c(20,10), model=c("low","high"))
ggplot() + xkcdline(mapping=aes(xbegin=x1 +y1, ybegin=y1,
xend =xend, yend= yend, color = model), data=data) +
xkcdaxis(range(0:20),range(10:20))
this can change the color of the lines according to the mapped aesthetic, but what if I want all the lines to be blue? I thought this would work
ggplot() + xkcdline(mapping=aes(xbegin=x1 +y1, ybegin=y1,
xend =xend, yend= yend), data=data, color = "blue") +
xkcdaxis(range(0:20),range(10:20), color = "blue")
but it just seems to ignore the color assignment and the result is black lines. I could just use a dummy variable and change the color manually, but that trick would not work with xkcdaxis()
. Any suggestions?