directlabels - dotplot - Positioning Method - top.qp

Label points at the top, making sure they don't collide.

top.qp <- list(
  "top.points",
  "calc.boxes",
  qp.labels(
    "x","left","right",
    make.tiebreaker("y","x"),
    xlimits))
vadeaths-lattice

vadeaths-lattice

library(lattice)
p <- dotplot(VADeaths,xlim=c(8,85),type="o")
direct.label(p,"top.qp")
  
vadeaths

vadeaths

vad <- as.data.frame.table(VADeaths)
names(vad) <- c("age","demographic","deaths")
library(ggplot2)
p <- qplot(deaths,age,data=vad,group=demographic,geom="line",colour=demographic)+
  xlim(8,80)
direct.label(p,"top.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 edd0c5b Mon, 28 Jun 2021 10:54:29 +0530) using inlinedocs.
validate