grantmcdermott / tinyplot

Lightweight extension of the base R graphics system
https://grantmcdermott.com/tinyplot
Apache License 2.0
259 stars 8 forks source link

Types: `abline`, `hline`, `vline` #249

Closed vincentarelbundock closed 1 week ago

vincentarelbundock commented 2 weeks ago
library(tinyplot)

tinyplot(mpg ~ hp, data = mtcars)
tinyplot_add(type = type_vline(150))


cols = c("black", "green", "orange")
tinyplot(mpg ~ hp | factor(cyl), facet = ~ factor(cyl), data = mtcars, col = cols)
tinyplot_add(type = type_vline(
  v = c(100, 150, 200), col = cols, lty = 3, lwd = 3
))

Created on 2024-11-12 with reprex v2.1.1

vincentarelbundock commented 2 weeks ago

I feel like the whole refactor is paying off in a really big way now :)

grantmcdermott commented 1 week ago

Brilliant, thanks!

I've got some pressing deadlines at work. But will try to take a look at your other PRs later today.