scale_x_gnuplot: gnuplot-like (continuous) axes for ggplot2

Description Usage Arguments See Also Examples

View source: R/ggnuplot.R

Description

These functions set up gnuplot-like secondary axes. They also try to choose pretty breaks/ticks for continuous data. Your mileage with the breaks/ticks may vary, so be sure to try different settings.

Usage

1
2
3
scale_x_gnuplot(breaks = gnubreaks(), sec.axis = gnuaxis(), ...)
scale_y_gnuplot(breaks = gnubreaks(), sec.axis = gnuaxis(), ...)
gnubreaks(n = 5, padding = 0.1)

Arguments

breaks

One of:

  • NULL for no breaks

  • waiver() for the default breaks computed by the transformation object

  • A numeric vector of positions

  • A function that takes the limits as input and returns breaks as output (e.g., a function returned by scales::extended_breaks())

sec.axis

sec_axis() is used to specify a secondary axis.

...

Other arguments passed on to scale_(x|y)_continuous()

n

The number of breaks/ticks to return

padding

The amount of space between the outermost breaks/ticks and the axis limits relative to the axis range. A number between 0 and 0.5.

See Also

The labeling package for alternative break/tick functions, and ggplot2::dup_axis(), for which gnuaxis() is an alias

Examples

1
2
3
4
5
6
7
8
library(ggplot2)

ggplot(iris, aes(Sepal.Width, Sepal.Length, color = Species)) +
  geom_point() +
  scale_color_gnuplot() +
  scale_x_gnuplot() +
  scale_y_gnuplot() +
  theme_gnuplot()

hriebl/ggnuplot documentation built on June 6, 2020, 1:33 a.m.