Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

scale_break

scale_x_break


Description

Set an axis break point for a 'gg' plot

Usage

scale_x_break(breaks)

scale_y_break(breaks)

Arguments

breaks

break point

Details

This scale function set an axis break point for a 'gg' plot. Either 'x' and 'y' axes are supported. The result is still a 'gg' object and user can progressively add layers to it.

Value

gg object

Author(s)

Guangchuang Yu

Examples

require(ggplot2 )
set.seed(2019-01-19)
d <- data.frame(
  x = 1:20,
  y = c(rnorm(5) + 4, rnorm(5) + 20, rnorm(5) + 5, rnorm(5) + 22)
)

p <- ggplot(d, aes(x, y)) + geom_col()
x <- p+scale_y_break(c(7, 17 ) )
print(x)

ggbreak

Set Axis Break for 'ggplot2'

v0.0.2
Artistic-2.0
Authors
Guangchuang Yu [aut, cre, cph] (<https://orcid.org/0000-0002-6485-8781>), Shuangbin Xu [aut] (<https://orcid.org/0000-0003-3513-5362>)
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.