Description Usage Arguments Aesthetics Author(s) Examples
This function lets you annotate the axes in a hive plot with labels and color coded bars.
1 2 |
mapping |
Set of aesthetic mappings created by |
data |
The data to be displayed in this layer. There are three options: If A A |
position |
Position adjustment, either as a string, or the result of a call to a position adjustment function. |
label |
Should the axes be labelled. Defaults to |
axis |
Should a rectangle be drawn along the axis. Defaults to |
show.legend |
logical. Should this layer be included in the legends?
|
... |
other arguments passed on to |
geom_axis_hive understand the following aesthetics.
alpha
colour
fill
size
linetype
label_size
family
fontface
lineheight
Thomas Lin Pedersen
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | # Plot the flare import graph as a hive plot
library(igraph)
flareGr <- graph_from_data_frame(flare$imports)
# Add some metadata to divide nodes by
V(flareGr)$type <- 'Both'
V(flareGr)$type[degree(flareGr, mode = 'in') == 0] <- 'Source'
V(flareGr)$type[degree(flareGr, mode = 'out') == 0] <- 'Sink'
analyticsNodes <- grep('flare.analytics', V(flareGr)$name)
E(flareGr)$type <- 'Other'
E(flareGr)[inc(analyticsNodes)]$type <- 'Analytics'
ggraph(flareGr, 'hive', axis = 'type') +
geom_edge_hive(aes(colour = type), edge_alpha = 0.1) +
geom_axis_hive(aes(colour = type)) +
coord_fixed()
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.