I don't understand how these plots differ from each other. I tweaked around with min
, max
, -min
, and -max
. But I don't really understand how and what these do!
library(tidyverse)
library(gghighlight)
library(patchwork)
A <- ggplot(d, aes(idx, value, colour = type)) +
geom_line() +
gghighlight(max(value), max_highlight = 5L)
B <- ggplot(d, aes(idx, value, colour = type)) +
geom_line() +
gghighlight(-max(value), max_highlight = 5L)
C <- ggplot(d, aes(idx, value, colour = type)) +
geom_line() +
gghighlight(min(value), max_highlight = 5L)
D <- ggplot(d, aes(idx, value, colour = type)) +
geom_line() +
gghighlight(-min(value), max_highlight = 5L)
(A + B) / (C + D) + patchwork::plot_annotation(tag_levels = "A")
So I thought more about the question and here is the answer:
A
highlights the lines with maximums of the top 5.B
highlights the lines with maximums of the bottom 5.C
highlights the lines with minimums of the top 5.D
highlights the lines with minimums of the bottom 5.