Skip to content

Conversation

@grantmcdermott
Copy link
Owner

@grantmcdermott grantmcdermott commented Aug 14, 2023

Closes #55. Simplifies things by ignoring the legend for any added elements. (Maybe we can revisit down the line.)

Simple penguins example.

library(plot2)
par(pch = 15)

data(penguins, package = "palmerpenguins")

plot2(bill_depth_mm ~ bill_length_mm | species, penguins, pch = "by", grid = TRUE)

penguins$pred = predict(lm(bill_depth_mm ~ bill_length_mm * species, penguins), newdata = penguins)

plot2(pred ~ bill_length_mm | species, penguins, type = "l", add = TRUE)

Created on 2023-08-13 with reprex v2.0.2

@grantmcdermott grantmcdermott marked this pull request as ready for review August 14, 2023 05:34
@grantmcdermott grantmcdermott merged commit 0c7db77 into main Aug 14, 2023
@grantmcdermott grantmcdermott deleted the add=TRUE branch August 14, 2023 05:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support plot2(..., add = TRUE)

2 participants