-
Notifications
You must be signed in to change notification settings - Fork 228
/
annotation_axis_grob.Rd
142 lines (128 loc) · 4.6 KB
/
annotation_axis_grob.Rd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
\name{annotation_axis_grob}
\alias{annotation_axis_grob}
\title{
Grob for Annotation Axis
}
\description{
Grob for Annotation Axis
}
\usage{
annotation_axis_grob(at = NULL, labels = at, labels_rot = 0, gp = gpar(),
side = "left", facing = "outside", direction = "normal", scale = NULL)
}
\arguments{
\item{at}{Break values. If it is not specified, it is inferred from data scale in current viewport.}
\item{labels}{Corresponding labels.}
\item{labels_rot}{Rotations of labels.}
\item{gp}{Graphic parameters.}
\item{side}{side of the axis of the annotation viewport.}
\item{facing}{Facing of the axis.}
\item{direction}{Direction of the axis. Value should be "normal" or "reverse".}
\item{scale}{The data scale. If it is \code{NULL}, it is inferred from current viewport.}
}
\value{
A \code{\link[grid:grid.grob]{grob}} object.
}
\examples{
gb = annotation_axis_grob(at = 1:5, labels = month.name[1:5], labels_rot = 0,
side = "left", facing = "outside")
grid.newpage()
pushViewport(viewport(xscale = c(0, 4), yscale = c(0, 6), width = 0.6, height = 0.6))
grid.rect()
grid.text('side = "left", facing = "outside"')
grid.draw(gb)
popViewport()
gb = annotation_axis_grob(at = 1:5, labels = month.name[1:5], labels_rot = 0,
side = "left", facing = "inside")
grid.newpage()
pushViewport(viewport(xscale = c(0, 4), yscale = c(0, 6), width = 0.6, height = 0.6))
grid.rect()
grid.text('side = "left", facing = "inside"')
grid.draw(gb)
popViewport()
gb = annotation_axis_grob(at = 1:5, labels = month.name[1:5], labels_rot = 0,
side = "right", facing = "outside")
grid.newpage()
pushViewport(viewport(xscale = c(0, 4), yscale = c(0, 6), width = 0.6, height = 0.6))
grid.rect()
grid.text('side = "right", facing = "outside"')
grid.draw(gb)
popViewport()
gb = annotation_axis_grob(at = 1:5, labels = month.name[1:5], labels_rot = 0,
side = "right", facing = "inside")
grid.newpage()
pushViewport(viewport(xscale = c(0, 4), yscale = c(0, 6), width = 0.6, height = 0.6))
grid.rect()
grid.text('side = "right", facing = "inside"')
grid.draw(gb)
popViewport()
gb = annotation_axis_grob(at = 1:3, labels = month.name[1:3], labels_rot = 0,
side = "top", facing = "outside")
grid.newpage()
pushViewport(viewport(xscale = c(0, 4), yscale = c(0, 6), width = 0.6, height = 0.6))
grid.rect()
grid.text('side = "top", facing = "outside"')
grid.draw(gb)
popViewport()
gb = annotation_axis_grob(at = 1:3, labels = month.name[1:3], labels_rot = 90,
side = "top", facing = "outside")
grid.newpage()
pushViewport(viewport(xscale = c(0, 4), yscale = c(0, 6), width = 0.6, height = 0.6))
grid.rect()
grid.text('side = "top", facing = "outside"')
grid.draw(gb)
popViewport()
gb = annotation_axis_grob(at = 1:3, labels = month.name[1:3], labels_rot = 45,
side = "top", facing = "outside")
grid.newpage()
pushViewport(viewport(xscale = c(0, 4), yscale = c(0, 6), width = 0.6, height = 0.6))
grid.rect()
grid.text('side = "top", facing = "outside"')
grid.draw(gb)
popViewport()
gb = annotation_axis_grob(at = 1:3, labels = month.name[1:3], labels_rot = 0,
side = "top", facing = "inside")
grid.newpage()
pushViewport(viewport(xscale = c(0, 4), yscale = c(0, 6), width = 0.6, height = 0.6))
grid.rect()
grid.text('side = "top", facing = "inside"')
grid.draw(gb)
popViewport()
gb = annotation_axis_grob(at = 1:3, labels = month.name[1:3], labels_rot = 0,
side = "bottom", facing = "outside")
grid.newpage()
pushViewport(viewport(xscale = c(0, 4), yscale = c(0, 6), width = 0.6, height = 0.6))
grid.rect()
grid.text('side = "bottom", facing = "outside"')
grid.draw(gb)
popViewport()
gb = annotation_axis_grob(at = 1:3, labels = month.name[1:3], labels_rot = 0,
side = "bottom", facing = "inside")
grid.newpage()
pushViewport(viewport(xscale = c(0, 4), yscale = c(0, 6), width = 0.6, height = 0.6))
grid.rect()
grid.text('side = "bottom", facing = "inside"')
grid.draw(gb)
popViewport()
grid.newpage()
pushViewport(viewport(xscale = c(0, 4), yscale = c(0, 6), width = 0.6, height = 0.6))
gb = annotation_axis_grob(labels_rot = 0, side = "left", facing = "outside")
grid.rect()
grid.text('side = "left", facing = "outside"')
grid.draw(gb)
popViewport()
grid.newpage()
pushViewport(viewport(xscale = c(0, 4), yscale = c(0, 6), width = 0.6, height = 0.6))
gb = annotation_axis_grob(side = "left", direction = "reverse")
grid.rect()
grid.text('side = "left", direction = "reverse')
grid.draw(gb)
popViewport()
grid.newpage()
pushViewport(viewport(xscale = c(0, 4), yscale = c(0, 6), width = 0.6, height = 0.6))
gb = annotation_axis_grob(side = "bottom", direction = "reverse")
grid.rect()
grid.text('side = "bottom", directio = "reverse"')
grid.draw(gb)
popViewport()
}