dl.move: Manually move a direct label

Description Usage Arguments Value Author(s) Examples

Description

Sometimes there is 1 label that is placed oddly by another Positioning Function. This function can be used to manually place that label in a good spot.

Usage

1
dl.move(group, x, y, ...)

Arguments

group

Group to change.

x

Horizontal position of the new label.

y

Vertical position of the new label. If missing(y) and !missing(x) then we will calculate a new y value using linear interpolation.

...

Variables to change for the specified group

Value

A Positioning Function that moves a label into a good spot.

Author(s)

Toby Dylan Hocking

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
library(ggplot2)
library(lattice)
scatter <- xyplot(jitter(cty)~jitter(hwy),mpg,groups=class,aspect=1)
dlcompare(list(scatter),
          list("extreme.grid",
               `+dl.move`=list(extreme.grid,dl.move("suv",15,15))))

p <- qplot(log10(gamma),rate,data=svmtrain,group=data,colour=data,
           geom="line",facets=replicate~nu)
adjust.kif <- dl.move("KIF11",-0.9,hjust=1,vjust=1)
dlcompare(list(p+xlim(-8,7)),
          list("last.points",
               `+dl.move`=list(last.points,adjust.kif)))

Example output



directlabels documentation built on May 2, 2019, 6:13 p.m.