I see several posts about changing line width in ggplot. The answers, while informative and effective for the OP, change the line size. That is, ggplot seems to treat lines as a series of units, and size increases both the length and width of each unit, making other adjustments coarser.
I'm hoping there is a way to make lines wider (thicker) without also affecting length and, in turn, the scale of dashes.
I borrowed some code from https://cran.r-project.org/web/packages/ggplot2/vignettes/ggplot2-specs.html to illustrate what I mean:
library(ggplot2)
#A simple plot with manually set dashes.
#The first numeral is units of dash length, the second units in the gap in hexadecimal.
lty <- c("11", "18", "1f", "81", "88", "8f", "f1", "f8", "ff")
linetypes <- data.frame(y = seq_along(lty), lty = lty)
ggplot(linetypes, aes(0, y)) +
geom_segment(aes(xend = 5, yend = y, linetype = lty)) +
scale_linetype_identity() +
geom_text(aes(label = lty), hjust = 0, nudge_y = 0.2) +
scale_x_continuous(NULL, breaks = NULL) +
scale_y_reverse(NULL, breaks = NULL)
#Altering the size changes the line width AND dash spacing.
ggplot(linetypes, aes(0, y)) +
geom_segment(aes(xend = 5, yend = y, linetype = lty),
size = 3) +
scale_linetype_identity() +
geom_text(aes(label = lty), hjust = 0, nudge_y = 0.3) +
scale_x_continuous(NULL, breaks = NULL) +
scale_y_reverse(NULL, breaks = NULL)
Essentially what I want is thick lines with relatively thin and finely adjusted gaps. I think this is the same question asked another way: Is there a way to make lines that are all, say, "dashed" vary in width but not in the relative location of the dashes? Like this (which I totally faked):