gg_log10_yaxis: Make Pretty ggplot y-Axis Log 10 Scale

Description Usage Arguments Value See Also Examples

View source: R/ubiquity.r

Description

Wrapper for gg_axis to create a log 10 y-axis

Usage

1
2
3
4
5
6
7
gg_log10_yaxis(
  fo,
  ylim_min = NULL,
  ylim_max = NULL,
  y_tick_label = TRUE,
  x_tick_label = TRUE
)

Arguments

fo

ggplot figure object

ylim_min

set to a number to define the lower bound of the y-axis

ylim_max

set to a number to define the upper bound of the y-axis

y_tick_label

TRUE to show y tick labels, FALSE to hide the y tick labels

x_tick_label

TRUE to show x tick labels, FALSE to hide the x tick labels

Value

ggplot object with formatted axis

See Also

gg_axis and gg_log10_xaxis

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
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)

Example output

Coordinate system already present. Adding new coordinate system, which will replace the existing one.

ubiquity documentation built on Sept. 5, 2021, 5:15 p.m.