From cbfaf1322cd187407a6400070909f4eb0cdf8482 Mon Sep 17 00:00:00 2001 From: Kyle Belanger Date: Fri, 16 Aug 2024 15:32:59 -0400 Subject: [PATCH] update graph --- LearnJulia/src/amtrak.jl | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/LearnJulia/src/amtrak.jl b/LearnJulia/src/amtrak.jl index b346672..6a7034a 100644 --- a/LearnJulia/src/amtrak.jl +++ b/LearnJulia/src/amtrak.jl @@ -5,7 +5,6 @@ using DataFrames using DataFramesMeta using Dates using Statistics -using AlgebraOfGraphics using CairoMakie using CategoricalArrays @@ -76,11 +75,10 @@ gd = @chain mod_df begin end end +f = Figure(); +ax = Axis(f[1,1], xlabel = "Station", ylabel = "Mean Delay (mins)", title = "Mean Delay by Station", xticks = (1:length(levels(gd.station_code)), levels(gd.station)), xticklabelrotation = pi/2) +barplot!(ax, gd.station_code, gd.mean, dodge = gd.train_code, color = gd.train_code) -# AlgebraOfGraphics -axis = (width = 750, height = 750, title = "Mean Delay by Station", xlabel = "Station", ylabel = "Delay (mins)",xticklabelrotation = 45) -mean_delay = data(gd) * mapping(:station, :mean, color = :train => "Train", dodge = :train) * visual(BarPlot) -draw(mean_delay; axis = axis) +f -# CairoMakie -CairoMakie.barplot(gd.station_code, gd.mean, dodge = gd.train_code, color = gd.train_code) \ No newline at end of file +levels(gd.station_code) \ No newline at end of file