I'm making a plot in ggplot2 with a line and a segment, the symbols for these appear overlapped. I can make it so that their symbols are either both an arrow or both a line using show.legend, but I'd like to make the segment an arrow and the line a line. I tried using override.aes to alter it after looking for a solution. changing the shape doesn't appear to do anything. setting the line to 0 makes everything disappear for that symbol.

library(tidyverse)
ggplot(NULL, aes(x=0, y=0)) + geom_point(alpha = 0) +
coord_cartesian(xlim = c(-2.5,2.5),ylim = c(-2.5,2.5)) +
geom_segment(aes(x=0, xend=1, y=0, yend=-2, color ="Vector a"), arrow = arrow(length = unit(0.5, "cm")), show.legend = T) +
geom_abline(aes(intercept=1, slope=1/2, color = "Line 1"), show.legend = T) +
scale_y_continuous(breaks=c(-2:2)) +
scale_x_continuous(breaks=c(-2:2)) +
scale_color_manual(values = c("green", "blue"), guide = guide_legend(override.aes = list(linetype = c(1,1),
shape = c(1,1)))) +
labs(
title = "plot (a) line",
x = "X Axis",
y = "Y Axis"
)
Thank you in advance for any advice you have in fixing my problem :).
EDIT: looking around I found out the symbol for either can be changed through key_glyph = draw_key_rect with various other draw_keys_ working. they'll still both display at the same time.
