Data Visualization
Under construction
Label line ends in time series with ggplot21
library(tidyverse)
<- Orange %>%
d as_tibble()
<- d %>%
d_ends group_by(Tree) %>%
top_n(1, age) %>%
pull(circumference)
%>%
d ggplot(aes(age, circumference, color = Tree)) +
geom_line(size = 2, alpha = .8) +
theme_minimal() +
scale_x_continuous(expand = c(0, 0)) +
scale_y_continuous(sec.axis = sec_axis(~., breaks = d_ends)) +
ggtitle("Orange trees getting bigger with age",
subtitle = "Based on the Orange data set in R") +
labs(x = "Days old", y = "Circumference (mm)")
Scientific figures
biorender.com reactome.org/icon-lib bioicons.com healthicons.org scidraw.io undraw.co smart.servier.com
Footnotes
https://drsimonj.svbtle.com/label-line-ends-in-time-series-with-ggplot2↩︎