This isn't a perfect representation of your graph and its requirements, but here's how you define expressions as labels in a legend guide and pass them into a ggplot() call.
varexp <- list(expression(alpha + beta*x), expression(gamma + delta*x),
expression(zeta + theta*x))
# Since y is passed in as the input data frame, you don't need
# to say y$value, y$variable, y$"epsilon_h" in ggplot()
ggplot(y, aes(x = epsilon_h, y = value, color = variable)) +
geom_point(shape = 1) +
scale_color_manual(breaks = levels(y$variable),
values = c("blue", "red", "green"),
labels = varexp) +
geom_smooth(method = lm, aes(linetype = variable), se = FALSE, fullrange = TRUE, size = 1.5) +
labs(x = expression(epsilon[h]), y = "value") +
xlim(-5000, -100) +
scale_linetype_manual(breaks = levels(y$variable),
values = c("solid", "dashed", "dotdash"),
labels = varexp) +
theme(legend.text = element_text(size = 12))
I tried using scale_color_hue() with leading arguments breaks, values and labels, but it returned an error:
Error in discrete_scale("colour", "hue", hue_pal(h, c, l, h.start, direction), :
unused argument(s) (values = c("blue", "red", "green"))
According to the help page, scale_*_hue() is supposed to be able to take such arguments at the beginning of the call and pass them to discrete_scale(), but I couldn't get that to work. Instead, I used scale_color_manual() and scale_linetype_manual() above. To darken the color hues, it appears that you'll need to find the hex values of the colors you want and substitute them for c("red", "blue", "green") in the values argument of scale_color_manual(). ggplot2 will not let you construct multiple legends for the same aesthetic.
On the off chance that you were not aware of this fact, if you want to merge two scales into one, they need to have the same breaks and labels, which is why varexp is passed as the value of the labels = argument in both legends.
Dennis