-
Notifications
You must be signed in to change notification settings - Fork 2k
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
ggsave() doesn't recognize .tif extension and device = agg_tiff() or tiff() is ignored #5323
Comments
Sorry, maybe I'm misunderstanding, but the request here is that |
Hi, I think the concept you're looking for is a constructor. That's a function call which returns, in this case, the relevant device object which should be used in writing the file. The use of a device constructor here follows the documentation (and quite a few examples).
That would address one of the two issues here, yes. |
But the device functions aren't constructors and return I think this is the recommended syntax, which is in working order even if you use
|
Right but |
The |
I'm going to mark this as completed, as it seems unlikely we're going to change the ggsave-device interface. |
If the interface isn't changing then the documentation is clearly incorrect, in which case it follows from the reasoning above the documentation is not a recommendation for how to use the code. Since it's difficult to argue such a situation constitutes completion I suggest the ggplot team reconsider. |
I'll explain how I reason about the documentation. For completeness, it reads:
So it can either be
ggsave("foo.tiff", device = tiff(compression = "lzw")) # produces an uncompressed TIFF file How is the documentation incorrect? It is not at all clear to me. |
As noted above, the documentation and most available examples say to use Per comments in this issue, device function design now appears to motivate argument expansion in the form of Past issues in this area show fragility around conflicts between |
I simply cannot find any examples of this, so I'm inclined to dismiss this argument, but willing to be proven wrong.
Yeah that seems broadly correct.
The documentation for
I'd agree that might be an improvement.
Again, I'm having a hard time finding examples of this.
I think mostly this mostly depends on device implementation and the best thing to do would be to lookup the documentation of the device rather than |
Attempted hello world, failed badly (.png and .jpg are fine as usual).
From replies in #3525 it appears
tiff(compression = "lzw")
might have worked in 2019 and reverted since.RStudio 2023.06.0 with AGG backend, R 4.2.3, ggplot 3.4.2.
The text was updated successfully, but these errors were encountered: