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:
|
sec.axis |
|
... |
Other arguments passed on to |
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()