I am trying to make a gadfly graph that includes a series of data points on it with a minimalist boxplot of those points right next to it for statistical comparison. Something like this graph here:
I have come pretty close with the following code:
nsurfacelayerpoint=layer(sort(normalstats[2:43,:],"population"), x="fishpopulation",y="median",
Stat.x_jitter(range=0.2),Geom.point,Theme(default_color=color("darkgray")))
nsurfacelayerbox=layer(sort(normalstats[2:43,:],"population"), x="fishpopulation",y="median",lower_hinge="q25",
upper_hinge="q75",Geom.boxplot,Theme(default_color=color("darkgray"),boxplot_spacing=3.4cm,errorbar_cap_length=0cm))
ncavelayerpoint=layer(sort(normalstats[44:96,:],"population"), x="fishpopulation",y="median",lower_hinge="q25",
upper_hinge="q75",Stat.x_jitter(range=0.8),Geom.point,Theme(default_color=color("black")))
ncavelayerbox=layer(sort(normalstats[44:96,:],"population"), x="fishpopulation",y="median",lower_hinge="q25",
upper_hinge="q75",Geom.boxplot,Theme(default_color=color("black"),boxplot_spacing=3.4cm))
Gadfly.plot(nsurfacelayerpoint,nsurfacelayerbox,Theme(grid_color="white"))
But the points and boxplots are overlapping which makes it difficult to read. Is there a way to shift the points left and the boxplots right such that they do not overlap? Or is there a better way to do this?