directlabels - lineplot - example - chemqqmathsex

data(Chem97,package="mlmRev")
library(lattice)
p <- qqmath(~gcsescore,Chem97,groups=gender,
       type=c("l","g"),f.value=ppoints(100))
angled.boxes

Draw a box with the label inside, at the point furthest away from the plot border and any other curve.

direct.label(p,"angled.boxes")
  
first.bumpup

Label first points, bumping labels up if they collide.

direct.label(p,"first.bumpup")
  
first.points

Positioning Method for the first of a group of points.

direct.label(p,"first.points")
  
first.polygons

Draw a speech polygon to the first point.

direct.label(p,"first.polygons")
  
first.qp

Label first points from QP solver that ensures labels do not collide.

direct.label(p,"first.qp")
  
lasso.labels

Label points at the zero before the first nonzero y value.

direct.label(p,"lasso.labels")
  
last.bumpup

Label last points, bumping labels up if they collide.

direct.label(p,"last.bumpup")
  
last.points

Positioning Method for the last of a group of points.

direct.label(p,"last.points")
  
last.polygons

Draw a speech polygon to the last point.

direct.label(p,"last.polygons")
  
last.qp

Label last points from QP solver that ensures labels do not collide.

direct.label(p,"last.qp")
  
lines2

Positioning Method for 2 groups of longitudinal data. One curve is on top of the other one (on average), so we label the top one at its maximal point, and the bottom one at its minimal point. Vertical justification is chosen to minimize collisions with the other line. This may not work so well for data with high variability, but then again lineplots may not be the best for these data either.

direct.label(p,"lines2")
  
maxvar.points

Do first or last, whichever has points most spread out.

direct.label(p,"maxvar.points")
  
maxvar.qp

Label first or last points, whichever are more spread out, and use a QP solver to make sure the labels do not collide.

direct.label(p,"maxvar.qp")
  
Please contact Toby Dylan Hocking if you are using directlabels or have ideas to contribute, thanks!
Documentation website generated from source code version 2021.2.24 (git revision bb6db07 Mon, 14 Jun 2021 22:38:45 +0530) using inlinedocs.
validate