using CSV, DataFrames, Gadfly
begin
candy_filepath = "data//archive//candy.csv"
candy_data = CSV.read(candy_filepath, DataFrame)
end;
plot(candy_data, x=:sugarpercent, y=:winpercent, Geom.point)
plot(candy_data, x=:sugarpercent, y=:winpercent, Geom.point, layer(Stat.smooth(method=:lm), Geom.line, Geom.ribbon))
plot(candy_data, x=:pricepercent, y=:winpercent, color=:chocolate, Geom.point,
Guide.colorkey(pos=[5mm,-20mm]))
plot(candy_data, x=:pricepercent, y=:winpercent, color=:chocolate, Geom.point, layer(Stat.smooth(method=:lm), Geom.line, Geom.ribbon))
plot(candy_data, x=:chocolate, y=:winpercent, Geom.beeswarm)
Built with Julia 1.9.1 and
CSV 0.10.9DataFrames 1.5.0
Gadfly 1.3.4
To run this tutorial locally, download [this file](/tutorials/gadflyscatter03x05.jl) and open it with Pluto.jl.