In [1]:
from lets_plot import *
In [2]:
LetsPlot.setup_html()
In [3]:
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()
)
Out[3]:
In [4]:
(ggplot(dat)
    + geom_crossbar(aes(y="animal", x="weight_m", xmin="weight_l", xmax="weight_h"))
    + theme_bw()
)
Out[4]:
In [5]:
(ggplot()
    + geom_crossbar(y=7, ymin=5, ymax=10)
    + theme_bw()
)
Out[5]:
In [6]:
(ggplot()
    + geom_crossbar(x=7, xmin=5, xmax=10)
    + theme_bw()
)
Out[6]:

Undefined Y

In [7]:
(ggplot(dat)
    + geom_crossbar(aes(x="animal", ymin="weight_l", ymax="weight_h"))
    + theme_bw()
)
Out[7]:
In [8]:
(ggplot()
    + geom_crossbar(ymin=5, ymax=10)
    + theme_bw()
)
Out[8]:

Undefined X

In [9]:
(ggplot(dat)
    + geom_crossbar(aes(y="animal", xmin="weight_l", xmax="weight_h"))
    + theme_bw()
)
Out[9]:
In [10]:
(ggplot()
    + geom_crossbar(xmin=5, xmax=10)
    + theme_bw()
)
Out[10]:

Box-plot : no X

In [11]:
(ggplot()
    + geom_boxplot(middle=8, lower=6, upper=9, ymin=5, ymax=10)
    + theme_bw()
)
Out[11]:

Box-plot : no Y

In [12]:
(ggplot()
    + geom_boxplot(middle=8, lower=6, upper=9, ymin=5, ymax=10, orientation="y")
    + theme_bw()
)
Out[12]: