hi: where would I find facilities to draw circles, ovals, and semicircles? (or should I construct them myself using curve?) regards, /ivo
On Friday 25 June 2004 09:11, ivo_welch-Rstat at mailblocks.com wrote:> hi: where would I find facilities to draw circles, ovals, and > semicircles? (or should I construct them myself using curve?)The latter probably, but using lines rather than curve (these being implicit/parametric functions). e.g. tt = seq(0, 2 * pi, length = 50) plot(cos(tt), sin(tt), type = 'l') Deepayan
The `ellipse' package is useful for drawing, well, ellipses/circles, but more in statistical context. -roger ivo_welch-Rstat at mailblocks.com wrote:> > hi: where would I find facilities to draw circles, ovals, and > semicircles? (or should I construct them myself using curve?) > > regards, /ivo > > ______________________________________________ > R-help at stat.math.ethz.ch mailing list > https://www.stat.math.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide! > http://www.R-project.org/posting-guide.html >-- Roger D. Peng http://www.biostat.jhsph.edu/~rpeng/
ivo_welch-Rstat at mailblocks.com wrote:> > hi: where would I find facilities to draw circles, ovals, and > semicircles? (or should I construct them myself using curve?) >We did semicircles last month, only they were called half-circles then: http://tolstoy.newcastle.edu.au/R/help/04/05/0849.html lines() and polygons() can draw just about anything. Baz
thanks, guys. circles might be a good candidate for a graphics primitive in the next R version, if only because---unlike the solutions here---I believe that postscript/pdf have scaleable primitives---though I am no postscript expert. of course, if I knew what I was talking about, I would just write the function and submit it. the closest I have found was in http://wtonline.vitalnews.com/Pages/Tip0163.html regards, /ivo
ivo welch wrote:> > thanks, guys. circles might be a good candidate for a graphics > primitive in the next R version,The 'symbols' function can draw circles, as well as a few other things - stars, squares, rectangles, boxplots and thermometers. Postscript produced with symbols' circles option does produce true scalable circles, but I don't think you can have true scalable postscript ellipses without some major hacking on R's device driver code! Baz
ivo_welch-Rstat at mailblocks.com wrote:> > hi: where would I find facilities to draw circles, ovals, and > semicircles? (or should I construct them myself using curve?) > > regards, /ivo >Here's a thread from the archive: http://finzi.psych.upenn.edu/R/Rhelp02/archive/4217.html --sundar
Circles *are* a graphics primitive in the sense that every R device driver has to support them. See PS_Circle and PDF_Circle in file src/main/devPS.c Note that PDF does not have arcs/circle as a primitive, unlike PS. One gotcha is that you have to be able to draw circles clipped to a viewport. OTOH, adding a graphic primitive (and we seem to need image for e.g. better drawing of the output of image and for icons etc) is a very serious undertaking. The R interfaces are symbols() and grid.circle. On Fri, 25 Jun 2004, ivo welch wrote:> thanks, guys. circles might be a good candidate for a graphics > primitive in the next R version, if only because---unlike the solutions > here---I believe that postscript/pdf have scaleable primitives---though > I am no postscript expert. of course, if I knew what I was talking > about, I would just write the function and submit it. the closest I > have found was in http://wtonline.vitalnews.com/Pages/Tip0163.html-- Brian D. Ripley, ripley at stats.ox.ac.uk Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272866 (PA) Oxford OX1 3TG, UK Fax: +44 1865 272595