View source: R/filledellipse.R
| filledellipse | R Documentation | 
plots (part of) outer and inner ellipses and colors inbetween; color can be a palette
filledellipse(rx1 = 1, rx2 = 0, ry1 = rx1, ry2 = NULL, mid = c(0,0), 
  dr = 0.01, angle = 0, from = -pi, to = pi, col = femmecol(100),  
  values = NULL, zlim = NULL, lwd = 2, lcol = NA, ...)
| rx1 | horizontal radius of outer ellipse. | 
| rx2 | horizontal radius of inner ellipse. | 
| ry1 | vertical radius of outer ellipse. | 
| ry2 | vertical radius of inner ellipse. | 
| mid | midpoint of ellipse. | 
| dr | size of segments, in radians, to draw ellipse (decrease for smoother). | 
| angle | rotation angle, degrees. | 
| from | starting angle for ellipse segment, radians. | 
| to | final angle for ellipse segment, radians. The segment is drawn counterclockwise. The default is draw a full ellipse. | 
| col | color palette to be used; also allowed are two extremes or one value. | 
| values | if not  | 
| zlim | Only if  | 
| lwd | width of external line. | 
| lcol | line color. | 
| ... | arguments passed to R-function polygon. | 
draws (part of) an outer and inner ellipse, as specified by inner and outer radiusses:
rx1,ry1: horizontal and vertical radiusses of outer ellipse;
rx2,ry2: same for inner ellipse.
Here "horizontal" and "vertical" denote the position BEFORE rotation
Fills with a palette of colors inbetween
values: if not NULL, a matrix providing (radius,z-values)
couples, used for coloring.
Here radius are positive values denoting the relative distance between
the shapes centre and edge.
The radiusses are rescaled to be in [0,1] if needed.
z-values (2nd column of values) together with zlim and
col denote the coloration level.
Colors in col will be interpolated to the z-values and used to
color an interval as given by the input radiusses.
If rx2, the radius of the inner ellipse is 0, the ellipse is full.
returns, as invisible a list containing "xyouter" and "xyinner", the points that define the outer and inner ellipse.
Karline Soetaert <karline.soetaert@nioz.nl>
filledshape, filledcylinder
color <- greycol(50)
dr    <- 0.05
emptyplot(xlim = c(-2, 2), ylim = c(-2, 2), col = color[length(color)], 
          main = "filledellipse")
filledellipse(rx1 = 1, mid = c(1, 1) , dr = dr, 
              col = shadepalette(endcol = "darkblue")) 
filledellipse(rx1 = 1, ry1 = 0.5, mid = c(-1, -1), dr = dr, angle = 90, 
              col = shadepalette(endcol = "darkred"))
filledellipse(rx1 = 1, ry1 = 0.5, rx2 = 0.5, dr = dr, mid = c(0, 0), 
              col = c(rev(color), color))
filledellipse(rx1 = 0.5, mid = c(1, -1), dr = dr, from = pi,  to = 1.5*pi, 
              col = rev(shadepalette(endcol = "black"))) 
filledellipse(mid = c(-1, 1))  
  
emptyplot(xlim = c(-2, 2), ylim = c(-2, 2), main = "filledellipse")
filledellipse(rx1 = 0.75, mid = c(-1, 1), col = greycol(100) , dr = dr,  
              values = cbind (1:100, (1:100)^0.5))
filledellipse(rx1 = 0.75, mid = c(1, 1), col = greycol(100)  , dr = dr,  
              values = cbind (1:100, (1:100)))
filledellipse(rx1 = 0.75, mid = c(-1, -1), col = greycol(100), dr = dr,  
              values = cbind (1:100, (1:100)^2))
filledellipse(rx1 = 0.75, mid = c(1, -1), col = greycol(100) , dr = dr,  
              values = cbind (1:100, (1:100)^5))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.