View source: R/plot.Intervals_virtual.R
plot.Intervals | R Documentation |
S3 methods for plotting "Intervals"
and "Intervals_full"
objects.
## S3 method for class 'Intervals'
plot(x, y, ...)
## S3 method for class 'Intervals_full'
plot(
x, y = NULL,
axes = TRUE,
xlab = "", ylab = "",
xlim = NULL, ylim = NULL,
col = "black", lwd = 1,
cex = 1,
use_points = TRUE,
use_names = TRUE,
names_cex = 1,
...
)
## S4 method for signature 'Intervals,missing'
plot(x, y, ...)
## S4 method for signature 'Intervals_full,missing'
plot(x, y, ...)
## S4 method for signature 'Intervals,ANY'
plot(x, y, ...)
## S4 method for signature 'Intervals_full,ANY'
plot(x, y, ...)
x |
An |
y |
Optional vector of heights at which to plot intervals. If omitted,
|
axes |
As for |
xlab |
As for |
ylab |
As for |
xlim |
As for |
ylim |
If not explicitly supplied, |
col |
Color used for segments and endpoint points and interiors. Recycled if necessary. |
lwd |
Line width for segments. See |
cex |
Endpoint magnification. Only relevant if |
use_points |
Should points be plotted at interval endpoints? |
use_names |
Should |
names_cex |
Segment label magnification. Only relevant if |
... |
Other arguments for |
Intervals with NA
for either endpoint are not
plotted. Vertical placement is on the integers, beginning with 0.
None.
# Note plot symbol for empty interval in 'from'.
from <- Intervals(
matrix(
c(
2, 8,
8, 9,
6, 9,
11, 12,
3, 3
),
ncol = 2, byrow = TRUE
),
closed = c( FALSE, TRUE ),
type = "Z"
)
rownames(from) <- c("a","b","c","d","e")
to <- Intervals(
matrix(
c(
2, 8,
3, 4,
5, 10
),
ncol = 2, byrow = TRUE
),
closed = c( FALSE, TRUE ),
type = "Z"
)
rownames(to) <- c("x","y","z")
empty(from)
plot(
c(from,to),
col = rep(1:2, c(nrow(from), nrow(to)))
)
legend("topright", c("from","to"), col=1:2, lwd=1)
# More intervals. The maximal height shown is adapted to the plotting
# window.
B <- 10000
left <- runif( B, 0, 1e5 )
right <- left + rexp( B, rate = 1/10 )
x <- Intervals( cbind( left, right ) )
plot(x, use_points=FALSE)
plot(x, use_points=FALSE, xlim = c(0, 500))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.