geom_errorbars
using TidierPlots
using DataFrames
df = DataFrame(
trt = [1, 1, 2, 2],
resp = [1, 5, 3, 4],
group = [1, 2, 1, 2],
lower = [0.8, 4.6, 2.4, 3.6],
upper = [1.1, 5.3, 3.3, 4.2],
)
4×5 DataFrame
Row | trt | resp | group | lower | upper |
---|---|---|---|---|---|
Int64 | Int64 | Int64 | Float64 | Float64 | |
1 | 1 | 1 | 1 | 0.8 | 1.1 |
2 | 1 | 5 | 2 | 4.6 | 5.3 |
3 | 2 | 3 | 1 | 2.4 | 3.3 |
4 | 2 | 4 | 2 | 3.6 | 4.2 |
geom_errorbar¤
ggplot(df, @aes(x = trt, ymin = lower, ymax = upper)) +
geom_errorbar(width=20, linewidth=2)
geom_errorbarh¤
ggplot(df, @aes(y = trt, xmin = lower, xmax = upper)) +
geom_errorbarh(width=20, linewidth=2)
This page was generated using Literate.jl.