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

Add argument log #15

Merged
merged 2 commits into from
Apr 11, 2023
Merged

Add argument log #15

merged 2 commits into from
Apr 11, 2023

Conversation

etiennebacher
Copy link
Contributor

As I said in #4, I'm not an expert with base R plots but it seems to work fine:

library(plot2)

# from ?plot.default
lx <- seq(1, 5, length.out = 41)
yl <- expression(e^{-frac(1,2) * {log[10](x)}^2})
y <- exp(-.5*lx^2)

plot(10^lx, y, log = "xy", type = "l", col = "purple",
     main = "Log-Log plot", ylab = yl, xlab = "x")

plot2(10^lx, y, log = "xy", type = "l", col = "purple",
     main = "Log-Log plot", ylab = yl, xlab = "x")

@grantmcdermott
Copy link
Owner

grantmcdermott commented Apr 11, 2023

Excellent! Let's see how the tests shake out. (There's a bit of a tricky situation in that we need the plots to have been generated from a Linux instance, which you hopefully are.)

UPDATE: Looks like you need to update the docs (devtools::document() or similar).

Could I also request an extra test using a logged axis (axes) and the by (or |) argument? Just want to make sure there isn't some unexpected interaction with grouped plots.

@etiennebacher
Copy link
Contributor Author

Looks like you need to update the docs (devtools::document() or similar).

Ah right, thanks

from a Linux instance, which you hopefully are.

Yes I have Ubuntu 22.10

Could I also request an extra test using a logged axis (axes) and the by (or |) argument?

Hum turns out it's trickier than I thought. I can't even put two plot2() side-by-side. I'll have a look tomorrow but feel free to jump into this one if you have time ;)

@grantmcdermott
Copy link
Owner

Hum turns out it's trickier than I thought. I can't even put two plot2() side-by-side.

That's an internal restriction. We can't use mfrow on grouped plot2's, because we need to alter the par's internally for legend adjustment etc. I'm hoping to fix/accommodate this in a future iteration. But for now, just feel free to test a single grouped plot a la plot2(log(Temp) ~ Day | Month, airquality).

@grantmcdermott
Copy link
Owner

grantmcdermott commented Apr 11, 2023

Closes #16.

@grantmcdermott grantmcdermott merged commit da584d2 into grantmcdermott:main Apr 11, 2023
5 checks passed
@grantmcdermott
Copy link
Owner

Will add another test separately. Thanks @etiennebacher!

@etiennebacher etiennebacher deleted the add-arg-log branch April 12, 2023 05:31
zeileis pushed a commit that referenced this pull request Apr 14, 2023
* add argument `log`

* `devtools::document()`
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.

None yet

2 participants