[R] Math symbols for labels in Perspective plots

Erin Hodgess hodgess at gator.dt.uh.edu
Sat Jun 10 08:23:57 CEST 2006


Dear Harsh:

I stole these lines from the Persp examples and 
the plotmath examples. 

>      x <- seq(-10, 10, length= 30)
>      y <- x
>      f <- function(x,y) { r <- sqrt(x^2+y^2); 10 * sin(r)/r }
>      z <- outer(x, y, f)
>      z[is.na(z)] <- 1
>      op <- par(bg = "white")
>      persp(x, y, z, theta = 30, phi = 30, expand = 0.5, col = "lightblue")
>      persp(x, y, z, theta = 30, phi = 30, expand = 0.5, col = "lightblue",
+            ltheta = 120, shade = 0.75, ticktype = "detailed",
+            xlab = "X", ylab = "Y", zlab = "Sinc( r )"
+      ) -> res
> 
> ?plotmath
> title( expression(paste(plain(sin) * phi, "  and  ",
+                                      plain(cos) * phi)))
> 


Hope this helps!

By the way, this is from Windows.

Sincerely,
Erin Hodgess
Associate Professor
Department of Computer and Mathematical Sciences
University of Houston - Downtown
mailto: hodgess at gator.uhd.edu


Subject: [R] Math symbols for labels in Perspective plots


Hi ..
  
     I would like to have math symbols in perspective plots
  
  i tried :  persp(x,y,z,xlab=expression(phi))
  
  but it plots it as phi.
  
  Thanks.
  
  Harsh
  
 __________________________________________________



More information about the R-help mailing list