scale_x_gnuplot {ggnuplot}R Documentation

gnuplot-like (continuous) axes for ggplot2

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

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

library(ggplot2)

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


[Package ggnuplot version 0.1.0 Index]