EVOLUTION-MANAGER
Edit File: xsplinePoints.html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><title>R: Return the points that would be used to draw an Xspline (or a...</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <link rel="stylesheet" type="text/css" href="R.css" /> </head><body> <table width="100%" summary="page for xsplinePoints {grid}"><tr><td>xsplinePoints {grid}</td><td style="text-align: right;">R Documentation</td></tr></table> <h2> Return the points that would be used to draw an Xspline (or a Bezier curve). </h2> <h3>Description</h3> <p>Rather than drawing an Xspline (or Bezier curve), this function returns the points that would be used to draw the series of line segments for the Xspline. This may be useful to post-process the Xspline curve, for example, to clip the curve. </p> <h3>Usage</h3> <pre> xsplinePoints(x) bezierPoints(x) </pre> <h3>Arguments</h3> <table summary="R argblock"> <tr valign="top"><td><code>x</code></td> <td> <p>An Xspline grob, as produced by the <code>xsplineGrob()</code> function (or a beziergrob, as produced by the <code>bezierGrob()</code> function). </p> </td></tr> </table> <h3>Details</h3> <p>The points returned by this function will only be relevant for the drawing context in force when this function was called. </p> <h3>Value</h3> <p>Depends on how many Xsplines would be drawn. If only one, then a list with two components, named x and y, both of which are unit objects (in inches). If several Xsplines would be drawn then the result of this function is a list of lists. </p> <h3>Author(s)</h3> <p>Paul Murrell </p> <h3>See Also</h3> <p><code><a href="grid.xspline.html">xsplineGrob</a></code> and <code><a href="grid.bezier.html">bezierGrob</a></code> </p> <h3>Examples</h3> <pre> grid.newpage() xsg <- xsplineGrob(c(.1, .1, .9, .9), c(.1, .9, .9, .1), shape=1) grid.draw(xsg) trace <- xsplinePoints(xsg) grid.circle(trace$x, trace$y, default.units="inches", r=unit(.5, "mm")) grid.newpage() vp <- viewport(width=.5) xg <- xsplineGrob(x=c(0, .2, .4, .2, .5, .7, .9, .7), y=c(.5, 1, .5, 0, .5, 1, .5, 0), id=rep(1:2, each=4), shape=1, vp=vp) grid.draw(xg) trace <- xsplinePoints(xg) pushViewport(vp) invisible(lapply(trace, function(t) grid.lines(t$x, t$y, gp=gpar(col="red")))) popViewport() grid.newpage() bg <- bezierGrob(c(.2, .2, .8, .8), c(.2, .8, .8, .2)) grid.draw(bg) trace <- bezierPoints(bg) grid.circle(trace$x, trace$y, default.units="inches", r=unit(.5, "mm")) </pre> <hr /><div style="text-align: center;">[Package <em>grid</em> version 3.6.0 <a href="00Index.html">Index</a>]</div> </body></html>