Bug 16721 - image() with png() plot error for certain pixel widths
Summary: image() with png() plot error for certain pixel widths
Status: ASSIGNED
Alias: None
Product: R
Classification: Unclassified
Component: Graphics (show other bugs)
Version: R-devel (trunk)
Hardware: All All
: P5 minor
Assignee: R-core
URL:
Depends on:
Blocks:
 
Reported: 2016-02-21 17:28 UTC by Dave Dixon
Modified: 2016-02-22 09:19 UTC (History)
1 user (show)

See Also:


Attachments
Plot with width=920 (40.55 KB, image/png)
2016-02-21 17:28 UTC, Dave Dixon
Details
Plot with width=919 (39.54 KB, image/png)
2016-02-21 17:29 UTC, Dave Dixon
Details
Code to reproduce (1.47 KB, text/x-r-source)
2016-02-22 03:36 UTC, Dave Dixon
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Dave Dixon 2016-02-21 17:28:18 UTC
Created attachment 2027 [details]
Plot with width=920

Plotting an image() heat map to png using

png("MonthlyTotal.png", width = 920, height = 460)
tacroHeatMap(total_table)
dev.off()

puts a very thin white vertical line in the plot 0.8 of the plot width. Reducing the width to 919 or increasing it to 922 eliminates the line. See attached images.
Comment 1 Dave Dixon 2016-02-21 17:29:03 UTC
Created attachment 2028 [details]
Plot with width=919
Comment 2 Uwe Ligges 2016-02-21 18:06:46 UTC
I cannot see this as your example code is not reproducible. Hence the problem you show in the attachment may be related to data or the function you use that is unknown to us.
Comment 3 Dave Dixon 2016-02-22 03:36:07 UTC
Created attachment 2029 [details]
Code to reproduce

I can't upload the data - it's 1.9 MB.
Comment 4 Uwe Ligges 2016-02-22 06:32:16 UTC
Comment on attachment 2029 [details]
Code to reproduce

Well, a minimal reproducible examples would be highly welcome. If that is too hard for you, feel free to send me the data by email.
Comment 5 Dave Dixon 2016-02-22 06:40:30 UTC
(In reply to Uwe Ligges from comment #4)
> Comment on attachment 2029 [details]
> Code to reproduce
> 
> Well, a minimal reproducible examples would be highly welcome. If that is
> too hard for you, feel free to send me the data by email.

Data sent.
Comment 6 Uwe Ligges 2016-02-22 09:19:19 UTC
Confirmed.

This is actually a bug with cairo (try type="Xlib" or something else in argument type for a workaround), I guess some numerical rounding problem.

Minimal example to reproduce it:

png("ImageWithWhiteStripe.png", width = 330, height = 200, type = "cairo")
image(matrix(1, nrow = 300, ncol = 1))
dev.off()