Description Usage Arguments Note Examples
geom_timeline_label() is used together with geom_timeline
for adding the annotations to the timeline. The subset is taken
the n_max number of earthquakes. Aesthetics are x, as the date of
earthquakes and label would be taken from the column name.
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 |
n_max |
A integer which indicates the number of the largest earthquakes to have the label |
stat |
The default set is |
position |
Position adjustment, either as a string, or the result of a call to a position adjustment function. |
na.rm |
If |
show.legend |
logical. Should this layer be included in the legends?
|
inherit.aes |
If |
... |
other arguments passed on to |
The aes xmin and xmax as the starting and ending
points of the timeline, which should be clarified.
The aes x is the date of the earthquakes
The optiona aes y is the a factor indicating some stratification
in which case multiple time lines will be plotted for each level of
the factor (e.g. COUNTRY)
The aes label is the column in the data frame to obtain
the text annotation
1 2 3 4 5 6 7 8 9 | ## Not run:
ggplot(input_data, aes (x = date, y = COUNTRY,
color = as.numeric(DEATHS), size = as.numeric(EQ_PRIMARY))) +
geom_timeline(aes(xmin = as.Date("1900-01-01"), xmax = as.Date("1925-01-01")) +
geom_timeline_label(aes(label = LOCATION_NAME,
xmin = as.Date("1900-01-01"), xmax = as.Date("1925-01-01")),
n_max = 5) +
theme_timeline()
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.