Michael Friendly
2007-Feb-16 16:46 UTC
[R] R implementations of scatterplot/map labeling algorithims?
Dear R community In a current paper, I'm (briefly) considering the topic of producing scatterplots or maps with point labels positioned in such a way as to minimize label overlap and occlusion. This is a topic with a large, but scattered literature. In CS, it is considered NP-hard, but there are a variety of approximate solutions. The most complete bibliography I've found is the Map-Labeling Bibliography, http://liinwww.ira.uka.de/bibliography/Theory/map.labeling.html AFAIK, the only concrete and published implementation is a Fortran program published by Noma (below), and then adapted by Warren Kuhfeld at SAS in PROC PLOT, and used in his %plotit macro. Journal Title - Psychometrika Article Title - Heuristic method for label placement in scatterplots Volume - Volume 52 Issue - 3 First Page - 463 Last Page - 468 Issue Cover Date - 1987-09-27 Author - Elliot Noma DOI - 10.1007/BF02294366 Link - http://www.springerlink.com/content/c4k6205r83156165 Does anyone know of a related R (or other) public implementation of a solution to this problem? thanks, -Michael -- Michael Friendly Email: friendly AT yorku DOT ca Professor, Psychology Dept. York University Voice: 416 736-5115 x66249 Fax: 416 736-5814 4700 Keele Street http://www.math.yorku.ca/SCS/friendly.html Toronto, ONT M3J 1P3 CANADA
Chuck Cleland
2007-Feb-16 16:56 UTC
[R] R implementations of scatterplot/map labeling algorithims?
Michael Friendly wrote:> Dear R community > > In a current paper, I'm (briefly) considering the topic of producing > scatterplots or maps with point labels positioned in such a way as to > minimize label overlap and occlusion. This is a topic with a large, but > scattered literature. In CS, it is considered NP-hard, but there are > a variety of approximate solutions. The most complete bibliography I've > found is > the Map-Labeling Bibliography, > http://liinwww.ira.uka.de/bibliography/Theory/map.labeling.html > > AFAIK, the only concrete and published implementation is a Fortran > program published by Noma (below), and then adapted by Warren Kuhfeld > at SAS in PROC PLOT, and used in his %plotit macro. > > Journal Title - Psychometrika > Article Title - Heuristic method for label placement in scatterplots > Volume - Volume 52 > Issue - 3 > First Page - 463 > Last Page - 468 > Issue Cover Date - 1987-09-27 > Author - Elliot Noma > DOI - 10.1007/BF02294366 > Link - http://www.springerlink.com/content/c4k6205r83156165 > > Does anyone know of a related R (or other) public implementation of a > solution to this problem?One thing that comes to mind is labcurve() in Frank Harrell's Hmisc package. "Optionally draws a set of curves then labels the curves. A variety of methods for drawing labels are implemented, ranging from positioning using the mouse to automatic labeling to automatic placement of key symbols with manual placement of key legends to automatic placement of legends. For automatic positioning of labels or keys, a curve is labeled at a point that is maximally separated from all of the other curves. Gaps occurring when curves do not start or end at the same x-coordinates are given preference for positioning labels. If labels are offset from the curves (the default behaviour), if the closest curve to curve i is above curve i, curve i is labeled below its line. If the closest curve is below curve i, curve i is labeled above its line. These directions are reversed if the resulting labels would appear outside the plot region."> thanks, > -Michael-- Chuck Cleland, Ph.D. NDRI, Inc. 71 West 23rd Street, 8th floor New York, NY 10010 tel: (212) 845-4495 (Tu, Th) tel: (732) 512-0171 (M, W, F) fax: (917) 438-0894
Henric Nilsson (Public)
2007-Feb-17 15:34 UTC
[R] R implementations of scatterplot/map labeling algorithims?
Den 2007-02-16 17:46, Michael Friendly skrev:> Dear R community > > In a current paper, I'm (briefly) considering the topic of producing > scatterplots or maps with point labels positioned in such a way as to > minimize label overlap and occlusion. This is a topic with a large, but > scattered literature. In CS, it is considered NP-hard, but there are > a variety of approximate solutions. The most complete bibliography I've > found is > the Map-Labeling Bibliography, > http://liinwww.ira.uka.de/bibliography/Theory/map.labeling.html > > AFAIK, the only concrete and published implementation is a Fortran > program published by Noma (below), and then adapted by Warren Kuhfeld > at SAS in PROC PLOT, and used in his %plotit macro. > > Journal Title - Psychometrika > Article Title - Heuristic method for label placement in scatterplots > Volume - Volume 52 > Issue - 3 > First Page - 463 > Last Page - 468 > Issue Cover Date - 1987-09-27 > Author - Elliot Noma > DOI - 10.1007/BF02294366 > Link - http://www.springerlink.com/content/c4k6205r83156165 > > Does anyone know of a related R (or other) public implementation of a > solution to this problem?Take a look at `thigmophobe.labels' in the `plotrix' package. HTH, Henric> > thanks, > -Michael >