gtable_legend.Rd 1.5 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/gtables.R
\name{gtable_legend}
\alias{gtable_legend}
\title{Build a grob containing a legend.}
\usage{
gtable_legend(
  d,
  labels,
  widths,
  heights,
  fg_fun,
  fg_params,
  bg_fun = NULL,
  bg_params = NULL,
  title_x = NULL,
  title_y = NULL,
  title_label = "Title",
  title_gp = gpar(fontsize = 10),
20
  labels_pad = -1,
21
  labels_gp = gpar(fontsize = 6),
22
23
  padding = 0.3,
  size_unit = "mm",
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
  name = "legend",
  vp = NULL,
  orientation = "horizontal",
  ...
)
}
\arguments{
\item{d}{data.frame or matrix}

\item{widths}{optional \code{unit.list} specifying the grob widths}

\item{heights}{optional \code{unit.list} specifying the grob heights}

\item{fg_fun}{grob-drawing function}

\item{fg_params}{named list of params passed to fg_fun}

\item{bg_fun}{grob-drawing function}

\item{bg_params}{named list of params passed to bg_fun}

\item{title_x}{\code{unit} specifying the x position of the title}

\item{title_y}{\code{unit} specifying the x position of the title}

\item{title_label}{character vector}

51
52
53
54
\item{padding}{numeric vector specifying the padding between adjacent cells.}

\item{size_unit}{character vector defining the unit used for sizes. See \code{grid::unit} for all possible
specifications.}
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70

\item{name}{optional name of the grob}

\item{vp}{optional viewport}

\item{...}{additional parameters passed to \code{add_table_params}.}
}
\value{
A gtable.
}
\description{
Build a grob with a legend inside.
}
\author{
Yoann Pradat
}