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
stop raster output from being resampled #55
Conversation
Thanks. Since the tests fail, I think we should make this an optional parameter for the |
Could you please also rebase to current |
Hadn't thought of putting this under the "rasterResolution" flag; seems like the sensible option. |
…RasterResolution)
… pixels am working on OS X, so didn't notice this before!
… the test builds run from Linux, so convert to an X11 PNG
sorry about all those commits; I forgot a couple of issues and OS X and Linux appear to produce different PNGs which cause the tests to fail. everything seems to be working now! |
Thanks, I'm fine with the commits. Could you please add documentation, and an item to |
|
||
res = getOption('tikzRasterResolution') | ||
if (is.null(res)) res = NA; | ||
if (is.na(res)) interpolate = FALSE; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
else if
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, now I see that else
would be wrong. Sorry.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, maybe a comment explaining what I'm doing would help?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would make things clearer. On the other hand, does the setting of interpolate
make a difference at all if res
is NA
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, it seems to make a difference. I get something very different from what I put in without this
@krlmlr, I've had a tidy up of the code based on your comments. |
stop raster output from being resampled
Thanks! |
tools::file_path_sans_ext(fileName), | ||
'_ras', rasterCount, '.png') | ||
|
||
res = getOption('tikzRasterResolution') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you can use res = getOption('tikzRasterResolution', NA)
and delete the three lines below
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hadn't noticed that parameter before—thanks! Have pushed an appropriate change to my noresample repo
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you please open a new pull request?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sorry, I'm sure when I get people hacking my repos I'll appreciate all these ways of moving code around!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm sure you will ;-) Merging with a few clicks is very comfortable indeed.
I'm now revisiting this code due to reentrance problems (#132), my approach is to write the raster "as is" using @smason: Do you think this makes sense? |
Yes, assuming I'm interpreting you correctly, it sounds reasonable. Whenever I've sent a raster to output in R I've wanted it preserved exactly, and any resampling would be very undesirable. Further, I've not noticed any other R device I've used resampling any raster given to it. |
Thanks for your fast reply. I've noticed that R seems to be doing all the resampling it needs already: In particular, the base_raster test looks almost unchanged when resampling is turned off; this was a pleasant surprise for me. |
Wrong: It's done by PGF, via |
this is in reference to issue #54