category_axis: Drawing categorized axis used with overdraw()

Description Usage Arguments See Also Examples

View source: R/plotn.R

Description

Drawing categorized axis used with overdraw()

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
category_axis(
  main,
  sub,
  data = NULL,
  main.axis.at = NULL,
  main.axis.length = 3,
  sub.axis.at = NULL,
  lwd = 1,
  bar.lwd = 1,
  cex.axis = 1.1,
  las.main = 1,
  las.sub = 1,
  x.intsp = 0.6,
  y.intsp = 1.8,
  horizontal = F
)

Arguments

main

Main category, this is given as vector (e.g. c("S", "R")) or column name of data

sub

Sub category, this is given as vector (e.g. c("1", "10", "100")) or column name of data

data

a data.frame

main.axis.at

Drawing position of main axis

main.axis.length

Bar length of main axis

sub.axis.at

Drawing position of sub axis

lwd

sub axis lwd, default is 1.

bar.lwd

main axis lwd, default is 1.

cex.axis

axis cex, default is 1.1.

las.main

las of main category

las.sub

las of sub category

x.intsp

Inter space of main axis bar, defauit is 0.6.

y.intsp

Inter space of main and sub axis, default is 1.8,

horizontal

horizontal, default is "F".

See Also

[plotn::overdraw]

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
d <- data.frame(x = c(1:10, 11:20, 21:30, 31:40),
                group = rep(c("A","B","A", "B"), each = 10),
                treatment = rep(c("X","Y"), each = 20))
boxplotn(x ~ group + treatment, data = d, xaxt = "n",
         xlab = "", mar = c(3.8, 3.8, 1, 1))
overdraw(category_axis(main = "treatment", sub = "group",
                       data = d))

boxplotn(x ~ group + treatment, data = d, xaxt = "n",
         xlab = "", mar = c(3.8, 3.8, 1, 1))
overdraw(category_axis(main = c("X", "Y"), sub = c("A", "B")))

bugplant/plotn documentation built on June 23, 2021, 1:18 a.m.