R/jamenrich-igraphshapes.R
jam_mypie.Rd
Vectorized mypie() function for igraph vertex pie polygons
jam_mypie(
x,
y,
values,
radius,
edges = 200,
col = NULL,
angle = 45,
density = NULL,
border = NULL,
frame.color = NULL,
frame.lwd = par("lwd"),
lty = NULL,
lwd = par("lwd"),
init.angle = 90,
inner_pie_border = getOption("inner_pie_border", TRUE),
inner_cex = 1.01,
xy_max = NULL,
overclose_polygons = FALSE,
...
)
numeric
coordinate for the center of each igraph
node.
numeric
vector of relative pie wedge sizes.
numeric
radius of pie
integer
number of edges to make a circle
character
vector of R colors to fill each pie wedge, in order
used to draw lines to fill each pie node, passed
to polygon()
character
vector of R colors for each pie wedge border
character
R color used around the entire pie circle.
numeric
or character
line type
numeric
angle in degrees (0 to 360) where 0
is the
top of the circle, proceeding clockwide.
logical
whether to apply pie.border
colors
only along the inside of each pie wedge polygon, so that adjacent
colors will be seen beside each other without overlapping adjacent
borders. This method is currently in development.
logical
indicating whether to close polygon
coordinates with an extra couple points, to ensure the line join
"ljoin"
is properly called when drawing each polygon.
additional arguments are passed to polygon()
data.frame
with columns suitable for use in polygon()
after each column is expanded to vector form. Columns x
and y
are stored AsIs()
in list
format, and should be combined
with one NA
value between each numeric
vector. The NA
values
cause polygon()
to draw a series of separate polygons in
one vectorized step, much faster than drawing a series of
polygons in an iterative loop.
This is a function called internally by shape.jampie.plot()
,
not intended for direct use.
See reorder_igraph_nodes()
for visual examples.
This function is a light rewrite of igraph:::mypie()
, except
that this function determines polygon coordinates without
drawing them, instead returns the polygon coordinates to
the calling function shape.jampie.plot()
which in turn
draws all polygons once using the vectorized approach
described for graphics::polygon()
.
See shape.jampie.plot()
for more detail.
To disable pie.border
set to NA
with vertex.pie.border=NA
or V(g)[[2]]$pie.border <- NA
.
To disable frame.color
set to NA
with vertex.frame.color=NA
or V(g)[2]$frame.color <- NA
.
Other jam igraph shapes:
shape.coloredrectangle.plot()
,
shape.ellipse.clip()
,
shape.ellipse.plot()
,
shape.jampie.plot()
# See reorder_igraph_nodes() for visual examples.