You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I believe I've found a problem with the ggsave function. When denoting width and height using the unit function imported from the grid package. ggsave accepts the arguments without problem but actually takes the numeric value to mean inches, instead of the unit denoted.
Using the units = argument fixes this, so perhaps the only changes are warnings and changing the documentation. Let me know if you agree, and I could file a PR if needed.
Thanks for spotting this. Yeah I'd agree that the documentation is a little bit on the ambiguous side; half-suggesting to use grid::unit() whereas one shouldn't. Throwing an error when is.unit(width) || is.unit(height) would be informative I think. A PR would we welcome!
I believe I've found a problem with the
ggsave
function. When denoting width and height using theunit
function imported from thegrid
package.ggsave
accepts the arguments without problem but actually takes the numeric value to mean inches, instead of the unit denoted.Using the
units =
argument fixes this, so perhaps the only changes are warnings and changing the documentation. Let me know if you agree, and I could file a PR if needed.Here is the code to reproduce the bug:
Created on 2023-06-29 with reprex v2.0.2
The text was updated successfully, but these errors were encountered: