prettyBreaks: Return "pretty" breaks for axis labelling.

Description Usage Arguments Details Value

View source: R/helpers.r

Description

This function is similar to pretty_breaks in package scales, but has advanced options for log scales, forced range limits, and separate generation of major and minor ticks (useful for labelling).

Usage

1
2
3
prettyBreaks(range, inner = TRUE, logsc = FALSE, majors = TRUE,
  minors = FALSE, n.major = 8, n.minor = 0, force.limits = FALSE,
  frac.log = FALSE)

Arguments

range

Numeric vector of length 2 giving the min and max input values.

inner

TRUE: return only "pretty" ticks within range; FALSE: return ticks spanning closest "pretty" ticks outside range.

logsc

Boolean, return values suitable for labelling log-scale axes.

majors

Boolean, return major ticks.

minors

Boolean, return minor ticks.

n.major

(Approximate) number of major ticks to return.

n.minor

Number of minor ticks to return between each pair of major ticks.

force.limits

If inner = TRUE, also include exact range values.

frac.log

Use fractions of log10 (10^0.5, 10^0.33, 10^0.25), to closer match desired number of ticks.

Details

Setting major = FALSE, minor=TRUE can be useful to return minor ticks only, e.g. to plot them in a different style than major ticks.

Value

A numerical vector of generated breaks.


thegeologician/ggprovenance documentation built on Sept. 26, 2021, 8:59 a.m.