Description Usage Arguments Aesthetics Examples
A geom for labeling the timeline plot from geom_timeline
This geom labels the timeline created from geom_timeline
It draws vertical lines up from the points on the timeline, with labels for the particular event.
You have the option of only labeleing the top x
number of events sorted by a given amount
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 |
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. |
na.rm |
If |
show.legend |
logical. Should this layer be included in the legends?
|
inherit.aes |
If |
x_min |
(optional) A Date object of the earliest data to be plotted |
x_max |
(optional) A Date object of the latest data to be plotted |
top_x_mag |
The top |
... |
other arguments passed on to |
geom_timeline
understands the following aesthetics (required are in bold):
x
label
The labels to be added
y
magnatude
The feature whose value determines the top x
to be labeled
color
fill
size
alpha
1 2 3 4 5 6 7 8 9 10 11 | data('clean_NOAA')
NOAA <- clean_NOAA
plot_NOAA <- NOAA[NOAA$COUNTRY=="USA" | NOAA$COUNTRY=="CANADA",]
xmin <- lubridate::ymd("2010-01-01")
xmax <- lubridate::ymd("2017-07-01")
plt <- ggplot2::ggplot(data = plot_NOAA, ggplot2::aes(x = DATE, y = COUNTRY)) +
geom_timeline(ggplot2::aes(size = EQ_PRIMARY), x_min = xmin, x_max = xmax) +
geom_timeline_label(ggplot2::aes(label = LOCATION_NAME, magnatude = EQ_PRIMARY),
x_min = xmin, x_max = xmax, top_x_mag = 5) +
ggplot2::theme_minimal()
print(plt)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.