I want the lines in a ggplot to plot side by side. So when two groups are having the same amount of cases on y axis I want both lines to be visible. adjusting Alpha is my last resort. I would rather want them to be plotted one over /under the other. Is there a way to do this?
I want the gold and red to be both visible...
my code is basic ggplot with geom_lines()
nothing fancy.
require(ggplot2,quietly = T)
ggplot(tinnel_sum,aes(Czas,Tinnel,group=Grupa,color=Grupa))+
geom_line(aes(y=jitter(Tinnel)))+
ggtitle("Suma szczurów z pozytywnym objawem Tinella \n
w każdej z grup, w zależności od czasu dla całej grupy")+
ylab("Liczba szczurów z pozytywnym objawem Tinella")+
theme_bw(base_size = 12)
the y
value is just an integer with values 0 - 12. which is a sum of observed cases.
That is it. It's pretty straighforward.
The jitter unfortunately adds unwanted curviness to lines that should otherwise be straight even if I set it to very low values 0.01
And I think there could be a better solution.