# Plotting points and boxplots on the same graph in Gadfly

**URL:** https://discourse.julialang.org/t/plotting-points-and-boxplots-on-the-same-graph-in-gadfly/108413
**Category:** Visualization
**Tags:** gadfly
**Created:** [January 5, 2024, 10:48pm UTC](https://discourse.julialang.org/t/plotting-points-and-boxplots-on-the-same-graph-in-gadfly/108413 "2024-01-05T22:48:23Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![bottaw](https://avatars.discourse-cdn.com/v4/letter/b/eb8c5e/32.png) [@bottaw](https://discourse.julialang.org/u/bottaw)
#### Post date: [January 5, 2024, 10:48pm UTC](https://discourse.julialang.org/t/plotting-points-and-boxplots-on-the-same-graph-in-gadfly/108413/1 "2024-01-05T22:48:23Z")

</div>

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:

 ![image](https://global.discourse-cdn.com/julialang/original/3X/6/2/6200441a2e9fc1a14d9f2b4ac7a93dbac8b3a939.png)

I have come pretty close with the following code:

```julia
		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?
