update graph
This commit is contained in:
parent
606e7639bc
commit
cbfaf1322c
1 changed files with 5 additions and 7 deletions
|
@ -5,7 +5,6 @@ using DataFrames
|
||||||
using DataFramesMeta
|
using DataFramesMeta
|
||||||
using Dates
|
using Dates
|
||||||
using Statistics
|
using Statistics
|
||||||
using AlgebraOfGraphics
|
|
||||||
using CairoMakie
|
using CairoMakie
|
||||||
using CategoricalArrays
|
using CategoricalArrays
|
||||||
|
|
||||||
|
@ -76,11 +75,10 @@ gd = @chain mod_df begin
|
||||||
end
|
end
|
||||||
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
|
f
|
||||||
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)
|
|
||||||
|
|
||||||
# CairoMakie
|
levels(gd.station_code)
|
||||||
CairoMakie.barplot(gd.station_code, gd.mean, dodge = gd.train_code, color = gd.train_code)
|
|
Loading…
Reference in a new issue