from lets_plot import *
LetsPlot.setup_html()
dat = dict(
animal = ["cow", "mouse", "horse"],
weight_l = [ 20, 5, 30 ],
weight_h = [ 27, 10, 39 ],
weight_m = [ 25, 7, 32 ],
)
(ggplot(dat)
+ geom_crossbar(aes(x="animal", y="weight_m", ymin="weight_l", ymax="weight_h"))
+ theme_bw()
)
(ggplot(dat)
+ geom_crossbar(aes(y="animal", x="weight_m", xmin="weight_l", xmax="weight_h"))
+ theme_bw()
)
(ggplot()
+ geom_crossbar(y=7, ymin=5, ymax=10)
+ theme_bw()
)
(ggplot()
+ geom_crossbar(x=7, xmin=5, xmax=10)
+ theme_bw()
)
(ggplot(dat)
+ geom_crossbar(aes(x="animal", ymin="weight_l", ymax="weight_h"))
+ theme_bw()
)
(ggplot()
+ geom_crossbar(ymin=5, ymax=10)
+ theme_bw()
)
(ggplot(dat)
+ geom_crossbar(aes(y="animal", xmin="weight_l", xmax="weight_h"))
+ theme_bw()
)
(ggplot()
+ geom_crossbar(xmin=5, xmax=10)
+ theme_bw()
)
(ggplot()
+ geom_boxplot(middle=8, lower=6, upper=9, ymin=5, ymax=10)
+ theme_bw()
)
(ggplot()
+ geom_boxplot(middle=8, lower=6, upper=9, ymin=5, ymax=10, orientation="y")
+ theme_bw()
)