Skip to content

tikzDevice compiling problem

3 messages · Yihui Xie, cuass

#
Hi guys.
The tex file which compile the following graphic has many problems. I don't
know what's happening. Any input would be really appreciated.  

# Cargo el prgrama que produce el c?digo en Latex
require(tikzDevice)

# Establezco directorio del programa
setwd('/Users/fabiangarcia/Documents/R') 

# El siguiente programa produce el archivo tex
tikz('CobbGRAF.tex', standAlone = TRUE, width=5, height=5)

# La gr?fica de la funci?n de utilidad
f = function(x, y) ((y)^1*(x)^1)
x = seq(0,5,len=40)
y = seq(0,5,len=40)
z = outer(x, y, f)
 showsurface = function(x, y, z) 
 persp3d(x,y,z, col="blue", alpha=0.3, axes=
 F)+{ 
 contours = contourLines(x,y,z)
 for (i in 1:length(contours)) {
  with(contours[[i]], lines3d(x, y, level, col="darkred"))
 }
 }
 open3d()
 showsurface(x,y,z)
 
 # Cierro el device
dev.off()

# Compilo el archivo tex
tools::texi2dvi('CobbGRAF.tex',pdf=F)
1 day later
#
I don't think tikz() can capture the plots in rgl. To export rgl
graphics, you need to use rgl.snapshot() or rgl.postscript().

Regards,
Yihui
--
Yihui Xie <xieyihui at gmail.com>
Phone: 515-294-2465 Web: http://yihui.name
Department of Statistics, Iowa State University
2215 Snedecor Hall, Ames, IA
On Wed, Feb 16, 2011 at 9:19 AM, cuass <fabianmauricio at hotmail.com> wrote:
2 days later