[R] number plot symbol in scatterplot?

Martin Maechler maechler at stat.math.ethz.ch
Fri Jan 3 16:30:03 CET 2003


>>>>> "BillS" == Simpson, William <William.Simpson at drdc-rddc.gc.ca>
>>>>>     on Fri, 3 Jan 2003 09:41:32 -0500 writes:

    BillS> If I make a scatterplot and several (e.g. 5) points
    BillS> lie on top of each other at a given x,y location I
    BillS> would like the plot symbol to be the number of
    BillS> superimposed points (e.g. "5"). Could someone please
    BillS> tell me how to do this in R? Thanks!

(typical Martin's answer:  ``You don't want what you are asking for'').

No, seriously, I think using sunflowerplot() {as recommended by
Chambers et al (1983) see help} is a bit better {-> ?sunflowerplot and examples}

Other solutions to the same problem:
 b. use jittering   jitter()

 c. use a ``2d density estimate'' and plot that
  1) e.g. use image on a 2d histog
  2) better use the "hexbin" package from bioconductor,
    this uses Dan Carr's Hexagons instead of squares and (some
     more ideas).

Regards,
Martin Maechler <maechler at stat.math.ethz.ch>	http://stat.ethz.ch/~maechler/
Seminar fuer Statistik, ETH-Zentrum  LEO C16	Leonhardstr. 27
ETH (Federal Inst. Technology)	8092 Zurich	SWITZERLAND
phone: x-41-1-632-3408		fax: ...-1228			<><




More information about the R-help mailing list