Skip to content
Prev 179619 / 398502 Next

dotplot: labeling coordinates for each point

On Thu, May 7, 2009 at 7:42 AM, Qifei Zhu <zhu_qifei at yahoo.com.sg> wrote:
In that case

dotplot(y ~ x, xlab="Store", ylab="Revenue", main="test",
        scales=list(x = list(draw = FALSE)),
        panel = function(x, y, ...) {
            panel.dotplot(x, y, ...)
            id <- y > 90
            panel.text(as.numeric(x[id]), y[id],
                       labels = sprintf("(%s,%g)", as.character(x[id]), y[id]),
                       pos = 4)
        })

-Deepayan