base_axis: base_axis

Description Usage Arguments Examples

View source: R/script - Axomatic.r

Description

Internal function that's gives axis_y() and axis_x() their base functionality. The function is used as a ggplot object.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
base_axis(
  xy,
  from,
  to,
  ticks = 1,
  labels = 1,
  pad = 0,
  upperPad = NA,
  lowerPad = NA,
  expand = 0,
  upperExp = NA,
  lowerExp = NA,
  trans = "identity",
  trans_labels = "none"
)

Arguments

xy

Whether this is a x ("x") axis or y axis ("y").

from

Start of the axis.

to

End of the axis.

ticks

How much space between each tickmark.

labels

The numbers or text beneath the tickmarks. 0 = no labels, 1 = label on every tickmark, 5 = label every 5'th tickmark, and so on. Setting this paramter as a vector lets you make self-defined labels, e.g. you can write c("one","two","three","four") or whatever.

pad

How much space before and after the first and last mark on the axis.

upperPad

specification of pad, but only for space after the last mark.

lowerPad

specifiction of pad, but only for spcae before the first mark.

trans_labels

"none": Does nothing (default). Lognatural: Transforms numerical labels back to non-logarithmic form if the axis data is log transformed

Examples

1
axis_x(from=0, to=20, ticks=1, labels=5, pad=2) #makes an axis going from 0 to 20, with 20 tickmarks, and labels every 5th tickmark, and a space of 2 before and after te marks

Eiriksen/axomatic documentation built on Dec. 29, 2021, 2:38 a.m.