Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

assign pt.lwd for type "p" in legend #320

Merged
merged 2 commits into from
Feb 18, 2025

Conversation

kscott-1
Copy link
Contributor

@kscott-1 kscott-1 commented Feb 17, 2025

Fixes #319. Looking at the issue I posted earlier, it appears that the jitter plot is internally referenced as "p" type. While my knowledge of this codebase is next to nothing, I don't believe there should be unintended consequences of this change because "p" should only include points. The changes allow for the legend to pick up the lwd argument in the case that the pch used during plotting can be impacted by that value. Happy to hear more if I have misunderstood this :)

set.seed(0)
x <- rep(c("A", "B", "C"), each = 20)
y <- runif(60)
gp <- sample(c("X", "Y", "Z"), size = 60, replace = TRUE)
df <- data.frame(x, y, gp)

library(tinyplot)
utils::packageVersion("tinyplot")
#> [1] '0.3.0.99'
plt(
  y ~ x | gp,
  data = df,
  pch = 0:2,
  lwd = 4,
  type = type_jitter()
)

Signed-off-by: Kyle Scott <kms309@miami.edu>
@grantmcdermott
Copy link
Owner

Thanks @kscott-1, good catch!

Do you mind adding/committing a short NEWS.md item under the "Bugs fixes" section? Please include your GH handle too, so that folks know who to credit.

I'll merge once that's done.

Signed-off-by: Kyle Scott <kms309@miami.edu>
@kscott-1
Copy link
Contributor Author

Thanks @grantmcdermott, let me know if that works for you. Glad I could contribute to a great project.

@vincentarelbundock
Copy link
Collaborator

This is very cool. Thanks for the bug fix!

@grantmcdermott grantmcdermott merged commit 9a56785 into grantmcdermott:main Feb 18, 2025
3 checks passed
@grantmcdermott
Copy link
Owner

Thanks!

@grantmcdermott
Copy link
Owner

(Your PR also reminded me of a separate issue related to handing of character variables and default types, which I'll address separately.)

@kscott-1 kscott-1 deleted the pt-lwd-patch branch February 18, 2025 01:32
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.

lwd not respected in legend for type_jitter
3 participants