adjustPolygon | R Documentation |
adjustPolygon
interactively moves vertices of a polygon and saves the result.
adjustPolygon(xy, colLine = "red", colPoly = "purple", alpha = 0.25, borderPoly = 'black', add = FALSE, closePoly = TRUE, lty = "solid", colBg = par()$bg, ...)
xy |
A matrix or data frame where the x-axis values (perhaps longitude) are in the first column and the y-axis column (perhaps latitude) are in the second column. |
colLine |
The color of line that is drawn while the points are adjusted. The default is red. |
colPoly |
The color for filling the polygon after the moving of the verticies has been finished. |
alpha |
An alpha transparency value for |
colBorder |
The color of the polygon border after the moving of the verticies has been finished. The default is black. (The same default as |
add |
When |
closePoly |
When |
lty |
The line type for the drawn lines and polygon. The default is: "solid" (equal to lty = 1). |
colBg |
The color to be used for the background of the device region. The default is the current background in par(): par()$bg |
... |
Addtional arguments passed to the |
A matrix or data frame (equal to the form of the xy
argument), with the final values as adjusted by the interactive manipulations
of the vertices is invisibly returned.
John R. Wallace: John.Wallace@noaa.gov
draw.polygon
, select.pts
## Not run:
EEZ_test <- adjustPolygon(EEZ.Polygon.WestCoast)
# Left click on a point and then left click where to move the point. Repeat with the same point or any other point.
# Right click to stop and the polygon will fill with 'colPoly' color (with transparency 'alpha') inside a border colored with 'borderPoly'.
# Readjust the result by using 'adjustPolygon' again
EEZ_test <- adjustPolygon(EEZ_test, colLine = 'green', colPoly = 'blue', borderPoly = 'green')
imap() # Zoom into the west coast of the contiguous United States, allowing room for the EEZ polygon.
adjustPolygon(EEZ.Polygon.WestCoast, add = TRUE) # Adjust the polygon as directed above.
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.