Add Line Segments To A Plot - R
Có thể bạn quan tâm
| segments {graphics} | R Documentation |
Add Line Segments to a Plot
Description
Draw line segments between pairs of points.
Usage
segments(x0, y0, x1 = x0, y1 = y0, col = par("fg"), lty = par("lty"), lwd = par("lwd"), ...)Arguments
| x0, y0 | coordinates of points from which to draw. |
| x1, y1 | coordinates of points to which to draw. At least one must be supplied. |
| col, lty, lwd | graphical parameters as in par, possibly vectors. NA values in col cause the segment to be omitted. |
| ... | further graphical parameters (from par), such as xpd and the line characteristics lend, ljoin and lmitre. |
Details
For each i, a line segment is drawn between the point (x0[i], y0[i]) and the point (x1[i], y1[i]). The coordinate vectors will be recycled to the length of the longest.
The graphical parameters col, lty and lwd can be vectors of length greater than one and will be recycled if necessary.
References
Becker RA, Chambers JM, Wilks AR (1988). The New S Language. Chapman and Hall/CRC, London.
See Also
arrows, polygon for slightly easier and less flexible line drawing, and lines for the usual polygons.
Examples
x <- stats::runif(12); y <- stats::rnorm(12) i <- order(x, y); x <- x[i]; y <- y[i] plot(x, y, main = "arrows(.) and segments(.)") ## draw arrows from point to point : s <- seq(length(x)-1) # one shorter than data arrows(x[s], y[s], x[s+1], y[s+1], col= 1:3) s <- s[-length(s)] segments(x[s], y[s], x[s+2], y[s+2], col= 'pink') [Package graphics version 4.6.0 Index]Từ khóa » How To Use Segments Function In R
-
Draw Line Segments Between Particular Points In R Programming
-
Segments Function - RDocumentation
-
The Segments R Function | 3 Example Codes - Statistics Globe
-
Draw Line Segment To Plot In R (Example) - YouTube
-
Segment Function - R
-
Segments: Add Line Segments To A Plot
-
R Segments Function Examples - EndMemo
-
Abline, Segments And Arrows Functions In R - R CHARTS
-
R: Using The Segments Function To Plot A Map Of Stacked Lines
-
R: Using The Segments Function To Plot A Map Of Stacked Lines
-
Line Segments And Curves — Geom_segment • Ggplot2
-
Draw Line Segment To Plot In Base R (Example) - Data Hacks
-
Add Line Segments To A Plot - R
-
11.7 Low-level Plotting Functions - YaRrr! The Pirate's Guide To R