xgx_breaks_log10: Sets the default breaks for log10

View source: R/xgx_breaks_log10.R

xgx_breaks_log10R Documentation

Sets the default breaks for log10

Description

xgx_breaks_log10 sets nice breaks for log10 scale. it's better than the default function because it ensures there is at least 2 breaks and also, it will try to go by 3s (i.e. 1,3,10,30,100) if it makes sense

Usage

xgx_breaks_log10(data_range)

Arguments

data_range

range of the data

Details

for the extended breaks function, weights is a set of 4 weights for

  1. simplicity - how early in the Q order are you

  2. coverage - labelings that don't extend outside the data: range(data) / range(labels)

  3. density (previously granularity) - how close to the number of ticks do you get (default is 5)

  4. legibility - has to do with fontsize and formatting to prevent label overlap

Value

numeric vector of breaks

References

Talbot, Justin, Sharon Lin, and Pat Hanrahan. "An extension of Wilkinson’s algorithm for positioning tick labels on axes." IEEE Transactions on visualization and computer graphics 16.6 (2010): 1036-1043.

Examples

xgx_breaks_log10(c(1, 1000))
xgx_breaks_log10(c(0.001, 100))
xgx_breaks_log10(c(1e-4, 1e4))
xgx_breaks_log10(c(1e-9, 1e9))
xgx_breaks_log10(c(1, 2))
xgx_breaks_log10(c(1, 5))
xgx_breaks_log10(c(1, 10))
xgx_breaks_log10(c(1, 100))
xgx_breaks_log10(c(1, 1.01))
xgx_breaks_log10(c(1, 1.0001))
print(xgx_breaks_log10(c(1, 1.000001)), digits = 10)


xgxr documentation built on March 31, 2023, 11:46 p.m.