xgxr (version 1.0.2)

xgx_breaks_log10: 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

Value

numeric vector of breaks

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

References

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

Examples

Run this code
# NOT RUN {
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)

# }

Run the code above in your browser using DataCamp Workspace