ggclip | R Documentation |
Toggles ggplot panel clipping.
ggclip(p, action = 'off')
p |
a ggplot object |
action |
turn clipping |
library(ggplot2)
library(grid)
(q <- qplot(1:10, 1:10,size = I(10)) + scale_y_continuous(expand = c(0, 0)))
ggclip(q)
dat <- data.frame(time = 0:5, y = 0:5)
(p <- ggplot(dat, aes(x = time, y = y)) +
geom_area(alpha = .1) + theme_bw() +
scale_y_continuous(expand = c(0, 0)) +
scale_x_continuous(expand = c(0, 0)) +
theme(panel.grid.major = element_blank(),
panel.grid.minor = element_blank(),
axis.text.x=element_blank(),
axis.ticks.x=element_blank()) +
geom_segment(aes(x = 0, xend = 5 , y = 0, yend = 0), size = 1.5,
arrow = arrow(length = unit(0.6, 'cm'))))
ggclip(p)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.