grantmcdermott · GitHub

Fixes #27.

Tl;DR Users can opt into varying by groups along pch and lty via the "by" convenience keyword. The possibility for manual adjustment (#5) should still work the same, but this makes the process a bit less error prone from the user side.

Quick examples:

library(plot2)
plot2(
  Temp ~ Day | Month,
  data = airquality,
  type = "l",
  col = "black", # override automatic group colours
  lty = "by"     # change line type by group instead
)

# Should automatically respond (and recycle if necessary) to global par settings
par(pch=16)
plot2(
  Temp ~ Day | Month,
  data = airquality,
  type = "b",
  palette = "Tableau 10",
  pch = "by", # pch adjustment should be from 16 onwards
  lty = "by"
)

Created on 2023-04-15 with reprex v2.0.2

Read the original on github.com ↗