Learn R Programming

ggraph (version 0.1.1)

geom_node_arc_bar: Show nodes as circles

Description

This geom is equivalent in functionality to geom_circle and allows for plotting of nodes as circles with a radius scaled by the coordinate system. Beceause of the geoms reliance on the coordinate system it will only produce true circles when combined with coord_fixed

Usage

geom_node_arc_bar(mapping = NULL, data = NULL, position = "identity", show.legend = NA, ...)

Arguments

mapping
Set of aesthetic mappings created by aes or aes_. By default x and y are mapped to x0 and y0 in the node data.
data
A data frame. If specified, overrides the default data frame defined at the top level of the plot.
position
Position adjustment, either as a string, or the result of a call to a position adjustment function.
show.legend
logical. Should this layer be included in the legends? NA, the default, includes if any aesthetics are mapped. FALSE never includes, and TRUE always includes.
...
other arguments passed on to layer. There are three types of arguments you can use here:
  • Aesthetics: to set an aesthetic to a fixed value, like color = "red" or size = 3.
  • Other arguments to the layer, for example you override the default stat associated with the layer.
  • Other arguments passed on to the stat.

Aesthetics

geom_node_point understand the following aesthetics. Bold aesthetics are automatically set, but can be overridden.
  • x0
  • y0
  • r
  • alpha
  • colour
  • fill
  • shape
  • size
  • stroke
  • filter

See Also

Other geom_node_*: geom_node_circle, geom_node_point, geom_node_text, geom_node_tile

Examples

Run this code
require(igraph)
gr <- graph_from_data_frame(flare$edges, vertices = flare$vertices)
ggraph(gr, 'circlepack', weight = 'size') + geom_node_circle() + coord_fixed()

Run the code above in your browser using DataLab