R/egg.projection.R

#' Plot egg projection
#'
#' Plot the equirectangular projection of the egg surface
#'
#' @param pixels an object of class \code{egg.pixels} containing the spherical coordinates and colour of each image pixel
#' @param ... further parameters to be passed to \code{\link{plot}}
#'
#' @return None
#'
#' @examples
#' stop()
#'
#' @export
egg.projection = function(pixels, ...) {
  sph = pixels$coords
  col = pixels$col
  plot(sph[,2], sph[,3], col=col, asp=1, ylim=rev(c(0,pi)), xlim=rev(c(0,pi)), xlab=expression(paste(italic(theta)," (radians)")), ylab=expression(paste(italic(phi)," (radians)")), axes=FALSE, ...)
  axis(1, at=seq(0,pi,pi/4), labels=c("0",expression(pi/4),expression(pi/2),expression(paste("3",pi/4)),expression(pi)))
  axis(2, at=seq(0,pi,pi/4), labels=c("0",expression(pi/4),expression(pi/2),expression(paste("3",pi/4)),expression(pi)))
  box()
}

Try the eggs package in your browser

Any scripts or data that you put into this service are public.

eggs documentation built on May 2, 2019, 5:23 p.m.