Anybody know how to rotate shapes generated with the 'points' function? I'm trying to place points around a radial diagram such that the y-axis of individual shapes are oriented with the radii of the circle rather than the y-axis of the larger plot area. Perhaps something analogous to the 'srt' and 'crt' functions for text that appear under 'par'? Thanks, Rich
I don't think that you can do this with points (though I would be happy to be proven wrong), but you could look at the my.symbols function in the TeachingDemos package. You need to create a function to plot the symbol that you want with the rotation that you want, but then you can use it to place the symbols/points on the plot with the desired rotation, see also the ms.polygram and ms.polygon functions for examples that include a possible rotation (adj argument). Hope this helps, ________________________________________ From: r-help-bounces at r-project.org [r-help-bounces at r-project.org] On Behalf Of Richard E. Glor [rglor at mail.rochester.edu] Sent: Monday, October 13, 2008 3:19 PM To: r-help at r-project.org Subject: [R] rotating points on a plot Anybody know how to rotate shapes generated with the 'points' function? I'm trying to place points around a radial diagram such that the y-axis of individual shapes are oriented with the radii of the circle rather than the y-axis of the larger plot area. Perhaps something analogous to the 'srt' and 'crt' functions for text that appear under 'par'? Thanks, Rich ______________________________________________ R-help at r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
On Mon, 13 Oct 2008, Richard E. Glor wrote:> Anybody know how to rotate shapes generated with the 'points' function? I'm > trying to place points around a radial diagram such that the y-axis of > individual shapes are oriented with the radii of the circle rather than the > y-axis of the larger plot area. Perhaps something analogous to the 'srt' and > 'crt' functions for text that appear under 'par'?There is no provision for this in the graphics engine. Assuming you are talking about pch=1:14, they are just drawn as line segments and could be done at R level by lines(). So I suggest writing an R-level emulation and rotating the coordinate system in your emulation. -- 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
Look at the China Sea graphic in the vignette to the gridbase package: http://cran.r-project.org/web/packages/gridBase/vignettes/gridBase.pdf On Mon, Oct 13, 2008 at 5:19 PM, Richard E. Glor <rglor at mail.rochester.edu> wrote:> Anybody know how to rotate shapes generated with the 'points' function? I'm > trying to place points around a radial diagram such that the y-axis of > individual shapes are oriented with the radii of the circle rather than the > y-axis of the larger plot area. Perhaps something analogous to the 'srt' > and 'crt' functions for text that appear under 'par'? > > Thanks, > Rich > > ______________________________________________ > R-help at r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code. >