val estimated = listOf(0.2, 0.3, 0.4, 0.1)
val observed = listOf(1, 2, 3, 4)
val probability = listOf(0.19, 0.31, 0.42, 0.08)
val values = listOf(1, 2, 3, 4)
val data = mapOf(
"xs" to observed + values,
"ys" to estimated + probability,
"group" to List(4) {"A"} + List(4) {"B"}
)
var p = ggplot(data) + theme().legendPositionRight() +
geomLollipop(position = positionDodge(0.3)) {
x = "xs"
y = "ys"
color = "group"
} + scaleColorManual(values=listOf("red", "black"))
p = p + labs(title = "some title", x = "xLabel", y = "yLabel") +
ggsize(500, 350)