bb_aes()
for aesthetic mapping, that equivalents to ggplot2::aes()
.
library(bbplot)
p <- bbplot(mtcars, bb_aes(mpg, disp, col=factor(cyl)))
p + bb_point()
p2 <- p + bb_point() + bb_lm(bb_aes(group=cyl), lwd=2)
p3 <- p2 + bb_lm(col="red", lwd=3, lty='dotted')
par(mfrow=c(1,2))
p2; p3
- bb_point
- bb_lm
- more layers need to be added
p2 + bb_labs(title = "hello", sub = "just for demo",
xlab="this is xlab", ylab = "this is ylab") +
bb_title("hello world") # last one rules
g <- p2 +
bb_theme(col.main="red", cex.main=2,
mar = c(4, 4, 3, 1)) +
bb_title("applying graphics::par")
par(mfrow=c(1,2))
print(g)
p2 + bb_title("theme has no side effect")
bb_theme
has no side effect and will only apply to the bbplot
that
it added to. This is very important for developing pre-defined themes.
- develop pre-defined themes
Not yet implemented
Not yet implemented