View source: R/make_log_breaks.R
make_log_breaks | R Documentation |
make_log_breaks
creates a set of evenly spaced breaks and labels in
what will be a log-transformed axis. These are set up to be used with a
ggplot2 log-transformed axis like this, where "G" is whatever else you have
specified for a ggplot2 graph and "MyBreaks" is the output from running
make_log_breaks
: G + scale_y_log10(limits =
MyBreaks$axis_limits_log, breaks = MyBreaks$breaks, labels =
MyBreaks$labels)
If the limits are powers of 10, this will put breaks at
all powers of 10, and, if not, it will guess at reasonably spaced intervals.
Note that this will make it so that there are unlabeled tick marks between
the labels; this is to help make it clearer visually that the axis has been
log transformed.
make_log_breaks(data_range, axis_limits_log = NA)
data_range |
the range of values to be plotted on a log-transformed axis |
axis_limits_log |
desired axis limits for an axis that will be log transformed. Leave this as NA if you'd like us to make a reasonable guess. |
a list of log axis breaks and log axis labels
# none
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.