directlabels - scatterplot - example - mpglattice

data(mpg,package="ggplot2")
library(lattice)
p <- xyplot(jitter(cty)~jitter(hwy),mpg,groups=class,
       main="Fuel efficiency depends on car size")
ahull.grid

Label the closest point on the alpha hull of the data.

direct.label(p,"ahull.grid")
  
chull.grid

Label the closest point on the convex hull of the data.

direct.label(p,"chull.grid")
  
extreme.grid

Label each point cloud near the extremities of the plot region.

direct.label(p,"extreme.grid")
  
smart.grid

Search the plot region for a label position near the center of each point cloud.

direct.label(p,"smart.grid")
  
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