library(directlabels)
volcano3d <- melt(volcano)
names(volcano3d) <- c("x", "y", "z")
v <- ggplot(volcano3d, aes(x, y, z = z))
v2 <- v + stat_contour(aes(colour = ..level..))
direct.label(v2)
direct.label(v2,"top.points")
Note that this example is from
http://rgm2.lab.nig.ac.jp/RGM2/func.php?rd_id=directlabels:direct.label
Best,
Ista
> --
> You received this message because you are subscribed to the ggplot2 mailing
> list.
> Please provide a reproducible example: http://gist.github.com/270442
>
> To post: email ggp...@googlegroups.com
> To unsubscribe: email ggplot2+u...@googlegroups.com
> More options: http://groups.google.com/group/ggplot2
>
--
Ista Zahn
Graduate student
University of Rochester
Department of Clinical and Social Psychology
http://yourpsyche.org
On Mon, Aug 1, 2011 at 3:22 AM, Robert Bayesian
<robert....@gmail.com> wrote:
> Thank you for the solution. I see one problem with the package you
> mentioned. It doesn't put the number between contour lines.
Take a look at the directlabels docs. I think you can have fairly fine
control over where the labels appear, though I wasn't able to figure
it out without devoting more time that I have.
please see the
> difference:
>
> contour(volcano)
>
> Moreover, it requires colour aes(colour = ..level..) though I don't want.
Second part is easy enough, if a bit silly. Just set the color scale
to start and end on the same value
direct.label((v2 + scale_color_gradient(low = "#000000", high = "#000000")))