Description Usage Arguments Value Examples
Draws a curved segment from point (x0,y0)
to (x1,y1)
. The
segment is a framgent of a sinusoid, has a defined width and can either
have a single color or a color gradient.
1 2 3 4 5 6 7 8 9 10 11 12 13 |
x0 |
X coordinate of the starting point |
x1 |
X coordinate of the end point |
y0 |
X coordinate of the starting point |
y1 |
X coordinate of the end point |
width |
Width of the segment to plot |
nsteps |
Number of polygons to use for the segments. The more, the smoother the picture, but at the same time, the more time-consuming to display. |
col |
Color to use. Ignored if grad is not |
grad |
Gradient to use. Can be anything that
|
lty |
Line type for drawing of the segment. Use |
form |
"sin" for a sinusoidal segment. "line" for a straight segment. |
fix.pdf |
Draw a border around segments with line type lty in a desperate attempt to fix the PDF output. |
no value is returned
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | # a DNA strand
plot.new()
par( usr= c( 0, 4, -2.5, 2.5 ) )
w <- 0.4
cols <- c( "blue", "green" )
init <- c( -0.8, -0.5 )
pos <- c( 1, -1 )
step <- 0.5
for( i in rep( rep( c( 1, 2 ), each= 2 ), 5 ) ) {
curveseg( init[i], init[i] + step, pos[1], pos[2], width= w, col= cols[i] )
init[i] <- init[i] + step
pos <- pos * -1
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.