Description Usage Arguments Details Aesthetics Examples
geom_timeline_label
adds labels to a timeline generated by
geom_timeline
for a specified number of ranked events. It draws
vertical lines above points on the timeline and adds a label for each event.
1 2 3 |
mapping |
Set of aesthetic mappings created by |
data |
The data to be displayed in this layer. There are three options: If A A |
na.rm |
If |
show.legend |
logical. Should this layer be included in the legends?
|
stat |
The statistical transformation to use on the data for this layer, as a string. |
position |
Position adjustment, either as a string, or the result of a call to a position adjustment function. |
inherit.aes |
If |
n_max |
The top |
... |
Other arguments passed on to |
geom_timeline_label
provides one option to label the n_max
events sorted by a selected variable.
geom_timeline_label
understands the following aesthetics (required are
in bold):
x
label
Label to be added.
y
magnitude
Feature used to sort events.
n_max
color
fill
size
alpha
1 2 3 4 5 6 7 8 9 | ## Not run:
ggplot(data = earthquakes, aes(x = DATE, y = COUNTRY)) +
geom_timeline(xmin = "2000-01-01", xmax = "2018-12-31",
aes(color = TOTAL_DEATHS, size = EQ_PRIMARY)) +
geom_timeline_label(n_max = 5,
aes(label = LOCATION_NAME,
magnitude = EQ_PRIMARY))
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.