gg_log10_xaxis | R Documentation |
Wrapper for gg_axis
to create a log 10 x-axis
gg_log10_xaxis(
fo,
xlim_min = NULL,
xlim_max = NULL,
y_tick_label = TRUE,
x_tick_label = TRUE
)
fo |
ggplot figure object |
xlim_min |
set to a number to define the lower bound of the x-axis |
xlim_max |
set to a number to define the upper bound of the x-axis |
y_tick_label |
|
x_tick_label |
|
ggplot object with formatted axis
gg_axis
and gg_log10_xaxis
library("ggplot2")
df = data.frame(x = seq(0.01,10,.01),
y = seq(0.01,10,.01)^2)
p = ggplot(df, aes(x=x, y=y)) + geom_line()
# pretty up the axes
p = prepare_figure(fo=p, purpose="print")
# pretty log10 y-axis
p_logy = gg_log10_yaxis(fo=p)
# pretty log10 x-axis
p_logx = gg_log10_xaxis(fo=p)
# pretty log10 yx-axis
p_logxy = gg_axis(fo=p)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.