library(ggplot2)
# Basic scatter plot
p <- ggplot(mtcars, aes(x = wt, y = mpg)) + geom_point()
ggplotcli(p)
# With styling
ggplotcli(p, border = TRUE, grid = "major")
# Faceted plot
p <- ggplot(mtcars, aes(x = wt, y = mpg)) +
geom_point() +
facet_wrap(~cyl)
ggplotcli(p, width = 70, height = 16)
# Multiple geoms
p <- ggplot(mtcars, aes(x = mpg)) +
geom_histogram(aes(y = after_stat(density)), bins = 10) +
geom_density(color = "red")
ggplotcli(p)
Run the code above in your browser using DataLab