From murdoch.duncan at gmail.com  Wed Apr 20 20:34:51 2011
From: murdoch.duncan at gmail.com (Duncan Murdoch)
Date: Wed, 20 Apr 2011 14:34:51 -0400
Subject: [Rd] Sweave support added to rgl package
In-Reply-To: <1303320495063-3463653.post@n4.nabble.com>
References: <4DADD1E6.5040905@gmail.com>
	<1303320495063-3463653.post@n4.nabble.com>
Message-ID: <4DAF274B.5040608@gmail.com>

On 20/04/2011 1:28 PM, Sharpie wrote:
> Duncan Murdoch-2 wrote:
> >
> >  I have just committed some code to the rgl package on
> >  https://r-forge.r-project.org/projects/rgl/ to allow rgl images to be
> >  inserted into Sweave documents.  (This is not in the CRAN version yet.)
> >  It makes use of the custom graphics driver support added by Brian Ripley.
> >
> >  In R-devel (which will become R 2.14.0 next spring in New Zealand, next
> >  fall in most other places), usage is quite straightforward.  For
> >  example, code like this in a Sweave document:
> >
> >  <&lt;fig=true, grdevice=rgl.Sweave, pdf=false, stayopen=TRUE&gt;>=
> >  x<- rnorm(100); y<- rnorm(100); z<- rnorm(100)
> >  plot3d(x, y, z)
> >  @
> >
> >  will insert a .png snapshot of the figure.  Because that chunk has
> >  "stayopen=TRUE", it can be followed by another chunk to add
> >  to the figure, e.g.
> >
> >  <&lt;fig=true, grdevice=rgl.Sweave, pdf=false&gt;>=
> >  lines3d(x[1:10], y[1:10], z[1:10], col="red")
> >  @
> >
> >  All of this is possible in R 2.13.0, but it takes more work:  see the
> >  ?rgl.Sweave help page.
> >
> >  I will eventually add postscript and PDF output options as well, and
> >  perhaps some support for the LaTeX movie15 package, but those are not
> >  there yet.  Comments or bug reports are welcome.
> >
> >  Duncan Murdoch
> >
>
> This is great news Duncan!
>
> If you do consider adding support for movie15, the Asymptote graphics
> language may be handy:
>
> http://asymptote.sourceforge.net/
>
> Asymptote can embed 3D graphs into LaTeX documents that are fully
> zoomable/manipulatable. It also uses LaTeX to typeset the figure text.

Thanks.  That doesn't look easy, but it would indeed be a nice addition.

Duncan Murdoch


> -Charlie
>
>
> -----
> Charlie Sharpsteen
> Undergraduate-- Environmental Resources Engineering
> Humboldt State University
> --
> View this message in context: http://r.789695.n4.nabble.com/Sweave-support-added-to-rgl-package-tp3461163p3463653.html
> Sent from the R devel mailing list archive at Nabble.com.
>
> ______________________________________________
> R-devel at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel



[Rd] Sweave support added to rgl package
Duncan Murdoch