This guide is intended to show the direction of edges based on the aesthetics mapped to its progression, such as changing width, colour and opacity.
guide_edge_direction(
title = waiver(),
title.position = NULL,
title.theme = NULL,
title.hjust = NULL,
title.vjust = NULL,
arrow = TRUE,
arrow.position = NULL,
barwidth = NULL,
barheight = NULL,
nbin = 500,
direction = NULL,
default.unit = "line",
reverse = FALSE,
order = 0,
override.aes = list(),
...
)
A character string or expression indicating a title of guide.
If NULL
, the title is not shown. By default
(waiver()
), the name of the scale object or the name
specified in labs()
is used for the title.
A character string indicating the position of a title. One of "top" (default for a vertical guide), "bottom", "left" (default for a horizontal guide), or "right."
A theme object for rendering the title text. Usually the
object of element_text()
is expected. By default, the theme is
specified by legend.title
in theme()
or theme.
A number specifying horizontal justification of the title text.
A number specifying vertical justification of the title text.
Logical. Should an arrow be drawn to illustrate the direction.
Defaults to TRUE
The position of the arrow relative to the example edge.
A numeric or a grid::unit()
object specifying
the width of the colourbar. Default value is legend.key.width
or
legend.key.size
in theme()
or theme.
A numeric or a grid::unit()
object specifying
the height of the colourbar. Default value is legend.key.height
or
legend.key.size
in theme()
or theme.
A numeric specifying the number of bins for drawing the colourbar. A smoother colourbar results from a larger value.
A character string indicating the direction of the guide. One of "horizontal" or "vertical."
A character string indicating grid::unit()
for barwidth
and barheight
.
logical. If TRUE
the colourbar is reversed. By default,
the highest value is on the top and the lowest value is on the bottom
positive integer less than 99 that specifies the order of this guide among multiple guides. This controls the order in which multiple guides are displayed, not the contents of the guide itself. If 0 (default), the order is determined by a secret algorithm.
A list specifying aesthetic parameters of legend key.
ignored.
gr <- tidygraph::as_tbl_graph(highschool)
ggraph(gr, layout = 'kk') +
geom_edge_fan(aes(alpha = after_stat(index))) +
guides(edge_alpha = guide_edge_direction())
Run the code above in your browser using DataLab