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

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

3 Likes

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

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