log10_breaks | R Documentation |
log10_breaks
creates a vector of numbers fairly evenly spaced on a log 10 scale with 10
points. (They're more evenly spaced if "min" and "max" span 1 order of
magnitude.) The decimals aren't necessarily pretty, though, so you may want
to set "prettify" to TRUE if they're ugly.
log10_breaks(min, max, prettify = FALSE)
min |
minimum value to use for breaks |
max |
maximum value to use for breaks |
a numeric vector
data("ConcTime")
ggplot(ConcTime, aes(x = Time, y = Conc, color = ID)) +
geom_line() +
scale_y_log10(breaks = log10_breaks(min = min(ConcTime$Conc[ConcTime$Conc > 0]),
max = max(ConcTime$Conc)))
ggplot(ConcTime, aes(x = Time, y = Conc, color = ID)) +
geom_line() +
scale_y_log10(breaks = log10_breaks(min = min(ConcTime$Conc[ConcTime$Conc > 0]),
max = max(ConcTime$Conc),
prettify = TRUE))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.