View source: R/geom_wide_arc.R
geom_wide_arc | R Documentation |
'geom_wide_arc()' draws wide polygons between two sets of start and end coordinates.
geom_wide_arc(
mapping = NULL,
data = NULL,
geom = "polygon",
stat = "wide_arc",
position = "identity",
n = 100,
max.width = NULL,
y.offset = 0,
y.reverse = FALSE,
na.rm = FALSE,
show.legend = NA,
inherit.aes = TRUE,
...
)
mapping , data , stat , position , na.rm , show.legend , inherit.aes , ... |
As is standard for ggplot2. |
geom |
The geometric object to use to display the data, either as a
|
n |
The number of points to create for each alignment polygon (Default : '100'). |
max.width |
The maximum width of the arc in y-coordinate units. |
y.offset |
The y-axis coordinate from where the arc will start. |
y.reverse |
Set to 'TRUE' if the arc orientation should be flipped upside down. |
This geom is intended to draws wide arc polygons between self-alignments defined in PAF format.
Such alignments can be directly visualized using a wrapper function plotSelf
.
Input data is a data.frame
object that contains required aesthetics 'x' and 'y' coordinates as well as
'group' field that is required in order to determine which coordinates represent a single alignment.
Plotting coordinates
'geom_wide_arc()' require or can take the following aesthetics (required aesthetics are in bold):
- **x** - **group** - y (if not defined it will set to zero) - color - linewidth - linetype - alpha - fill - size
David Porubsky
[plotSelf()]
## Create example data.frame to plot ##
## Each link between sequence region1 (seq1) and sequence region2 (seq2)
## is expected to have 4 x-coordinates (start.seq1, start.seq2, end.seq1, end.seq2)
plt.df <- data.frame(
x = c(100, 500, 200, 1000),
group = 1
)
## Make a plot
ggplot2::ggplot(plt.df) +
geom_wide_arc(ggplot2::aes(x = x, group = group), alpha = 0.5)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.