ribbon.plot | R Documentation |
Given a series of 2-d points and values at these segments, the function colors the segments according to a color scale and the segment values. This is essentially an image plot restricted to line segments.
ribbon.plot(x,y,z,zlim=NULL, col=tim.colors(256),
transparent.color="white",...)
x |
x locations of line segments |
y |
y locations of line segments |
z |
Values associated with each segment. |
zlim |
Range for z values to determine color scale. |
col |
Color table used for strip. Default is our favorite tim.colors being a scale from a dark blue to dark red. |
transparent.color |
Color used for missing values. Default is that missing values make the ribbon transparent. |
... |
Optional graphical arguments that are passed to the
|
Besides possible 2-d applications, this function is useful to annotate a curve on a surface using colors. The values mapped to acolor scheme could indicate a feature other than the height of the surface. For example, this function could indicate the slope of the surface.
Doug Nychka
image.plot, arrow.plot, add.image, colorbar.plot
plot( c(-1.5,1.5),c(-1.5,1.5), type="n")
temp<- list( x= seq( -1,1,,40), y= seq( -1,1,,40))
temp$z <- outer( temp$x, temp$y, "+")
contour( temp, add=TRUE)
t<- seq( 0,.5,,50)
y<- sin( 2*pi*t)
x<- cos( pi*t)
z<- x + y
ribbon.plot( x,y,z, lwd=10)
persp( temp, phi=15, shade=.8, col="grey")-> pm
trans3d( x,y,z,pm)-> uv
ribbon.plot( uv$x, uv$y, z**2,lwd=5)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.