Hello,

why do I have arrows on the legend ?

f4= ggplot(data_long,aes(x=t,y=value, color=variable, linetype=variable))+

geom_line(size=1)+

geom_segment(aes(x=0, xend = N*1.1 , y=0, yend = 0), size=0.7,arrow = arrow(length = unit(0.3,"cm")), color='black') +

geom_segment(aes(x=0, xend = 0 , y=0, yend =Q+1), size=0.7,arrow = arrow(length = unit(0.3,"cm")), color='black') +

coord_cartesian(clip = "off")+

scale_linetype_manual(values=c("twodash","solid","dashed"), labels=c(TeX("X_t^1"),TeX("X_t^2"),TeX("X_t")))+

scale_color_manual(values=palette, labels=c(TeX("X_t^1"),TeX("X_t^2"),TeX("X_t")))+

geom_segment(x = 0 , xend = tbar, y = Q, yend = Q, linetype = "dashed", color = "red") +

geom_segment(x = tbar , xend = tbar, y = 0, yend = Q, linetype = "dashed", color = "red") +

scale_x_continuous(breaks=c(set(0,N,10,tbar),tbar),labels=c(as.character(set(0,N,10,tbar)),paste("t*=",tbar)), expand = c(0, 0), limits = c(0, N*1.1)) +

scale_y_continuous(breaks=seq(0,Q+1), labels=c(as.character(seq(0,Q-1)),paste("Q=",Q),""), expand = c(0, 0), limits = c(0, Q+1))+

theme(axis.title=element_text(size=14))+

ylab("")+

xlab(TeX("t"))+

theme_classic()

f4

Thanks for your help !