cranvas (version 0.8.5)

axis_loc: Calculate pretty locations of axis tick marks

Description

The pretty locations are calculated by the function pretty, but the locations that exceed the range of the data are removed. A special case is the factor: the locations are 1, 2, ..., up to the number of levels.

Usage

axis_loc(x)

Arguments

x
the data vector (either numeric or factor)

Value

a numeric vector of the axis tick marks locations

See Also

pretty

Examples

Run this code
library(cranvas)
axis_loc(1)
axis_loc(c(0, 1))
axis_loc(rnorm(100))
axis_loc(iris$Species)  # a factor, so locations are 1, 2, 3

Run the code above in your browser using DataCamp Workspace