Description Usage Arguments Details Aesthetics Author(s) Examples
'geom_timeline_label' adds text directly to the timeline plot.
1 2 3 4 |
n_max |
The number of the max size events to display the label. |
parse |
If TRUE, the labels will be parsed into expressions and displayed as described in ?plotmath |
check_overlap |
If 'TRUE', text that overlaps previous text in the same layer will not be plotted. |
geom_timeline_label() is for adding annotations to the earthquake data. This geom adds a vertical line to each data point with a text annotation (e.g. the location of the earthquake) attached to each line. There should be an option to subset to n_max number of earthquakes, where we take the n_max largest (by magnitude) earthquakes. Aesthetics are x, which is the date of the earthquake and label which takes the column name from which annotations will be obtained.
geom_timeline understand the following aesthetics (required aesthetics are 'x' and 'label'):
datetime of the event
the text to display
the size of the circle drawn at the event
the colour of the circle drawn at the event
free groupiong parameter
József Varga
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | eqdta <- eq_location_clean(eq_clean_data(earthquakes)) %>%
filter( date > ymd("20000101") & COUNTRY=="USA") %>%
head(n=5)
ggplot (data = eqdta,
aes(
x = date,
y = COUNTRY,
label = LOCATION_NAME,
size = FOCAL_DEPTH,
colour = EQ_PRIMARY
)) +
geom_timeline() +
geom_timeline_label(n_max=6)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.