addLabel | R Documentation |
Adds text in the margin for specialized axis labels.
addLabel(label, x, side = "bottom", size = "Auto", distance = 0.2, justification = "center", orientation = "parallel", current = list(yaxis.log = FALSE, yaxis.rev = FALSE, xaxis.log = FALSE))
label |
the text or expression to add to the graph. |
x |
the axis location in the correct user units. |
side |
the side to place |
size |
the size of the text in points. |
distance |
the distance from the axis, in lines of text. |
justification |
defines the placement of the text relative to |
orientation |
the orientation of the label relative to the axis. Must be either "parallel" or "perpendicular." |
current |
the current plot parameters. Typically, this would be the
output from one of the graph creation functions like |
Nothing is returned.
In general, all functions that create plots will draw the necessary
axes. This function should be used only to add axis labels to an unlabeled
axis. Axis labels can be suppressed by setting up the margins with negative
values or, for some functions, special arguments to xlabels
or
ylabels
.
addAxisLabels
,
mtext
and plotmath
for example expressions,
## Not run: set.seed(1) X <- as.POSIXct(c("2010-12-22 10:30", "2010-12-28 13:45", "2011-01-05 9:30", "2011-01-07 14:50")) Y <- runif(4) setGD() AA.pl <- timePlot(X, Y, Plot=list(what="points")) # Insert verical bar between years addLabel("|", as.Date("2011-01-01"), distance=1.2) # For more details of addLabel see vignette(topic="GraphGallery", package="smwrGraphs") demo(topic="AnnualFlowBarChart", package="smwrGraphs") ## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.