Description Usage Value Examples
This theme modifies the Classic Theme to display the geom_timeline
geometry.
The y axis line, ticks and title are hidden
The y axis line text is changed to darkgray with size 11 and a right-hand margin of 15
The x axis line colour black with a thickness of 1
The x axis text is changed to darkgray with size 11 with a top margin of 3
The x axis title is size 14 with a top margin of 5
The plot a title is added and justified horisontally in the middle of the plot
The legend is positioned at the bottom of the screen
1 |
A ggplot2 theme
1 2 3 4 5 6 7 8 9 10 11 12 13 | ## Not run:
readr::read_delim("earthquakes.tsv.gz",delim = "\t") %>%
eq_clean_data() %>%
dplyr::filter(COUNTRY == "USA" & lubridate::year(DATE) >= 2000) %>%
ggplot() +
geom_timeline(aes(x = DATE, y = COUNTRY,size = EQ_PRIMARY, colour = DEATHS)) +
geom_timeline_label(aes(x = DATE, y = COUNTRY, label = LOCATION_NAME,
size = EQ_PRIMARY), n_max = 5) +
ggtitle("Earthquake Timeline") +
theme_timeline() +
labs(size = "Richter Scale value:", colour = "# of Deaths:")
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.