# Using dodge/offset in scatter plot (StatPlots.jl)

**URL:** https://discourse.julialang.org/t/using-dodge-offset-in-scatter-plot-statplots-jl/10768
**Category:** New to Julia
**Tags:** plotting
**Created:** [May 7, 2018, 9:32pm UTC](https://discourse.julialang.org/t/using-dodge-offset-in-scatter-plot-statplots-jl/10768 "2018-05-07T21:32:21Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![amckay1](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/amckay1/32/8280_2.png) [@amckay1](https://discourse.julialang.org/u/amckay1)
#### Post date: [May 7, 2018, 9:32pm UTC](https://discourse.julialang.org/t/using-dodge-offset-in-scatter-plot-statplots-jl/10768/1 "2018-05-07T21:32:21Z")

</div>

Sorry, I’ve been looking everywhere and haven’t found the answer so I thought I should ask: I was attempting to using the @df macro on a JuliaDB table in the hopes of creating a scatter plot. My scatter plot looks good, but being categorical on x-axis and integers on y-axis, may points are hidden by overlap. Is there a way to offset the y-axis values in the horizontal by a “dodge” attribute or something of the like? My rough code (without horizontal offsets) is as follows, with the categorical data being “:date”, “:tally” being the integer, and “:id” being the group value that populates the legend:

using Plots, JuliaDB, StatPlots  
t = loadtable(“mydata.csv”)  
@df t scatter(:date, :tally, group = :id)

Thank you for your help and please let me know if anything is unclear! -Andrew

---

<div class="post-metadata">

### Author: ![Dario\_Sarra](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/dario_sarra/32/9338_2.png) [@Dario\_Sarra](https://discourse.julialang.org/u/Dario_Sarra)
#### Post date: [September 29, 2022, 11:15am UTC](https://discourse.julialang.org/t/using-dodge-offset-in-scatter-plot-statplots-jl/10768/2 "2022-09-29T11:15:19Z")

</div>

If you don’t need to add error bars to your scatter plot you can use the dotplot() function instead of scatter()

```julia
@df t dotplot(:date, :tally, group = :id)

```
