Open hturner opened 4 hours ago
Part 2: Image to check orientation
In the first part, the raster (black square) was symmetrical about the diagonal from bottom-left (blue square) to top-right (red square). For the second image, we will use a non-symmetrical matrix that depicts an "F" shape:
This will help us check if rasterImage()
preserves the order of cells within thewhen the axes are rotated (i.e. when the location of "bottom-left" and "top-right" are not in the same orientation as the canvas). When everything is working correctly, the plot should look something like this:
Warning: we think this will display correctly in the Cairo device, but it might not! Do not adapt the code to fix any problems you see!
Todo:
line()
or grid.line()
(you might play with line thickness/colour so we can see the overplotting). These F's should look correct on the Cairo device (and hopefully all devices, so we have a correct reference).png()
This task is to create some test images to help with fixing Bug 17148. It has two parts - the second should only be attempt once the first is completed at least for the Cairo device.
Part 1: Image to check rotation
The following hand-drawn image is intended to demonstrate the documented behaviour of rasterImage:
We expect this image to display correctly on a Cairo device, but incorrectly on other devices. You can draw on a Cairo device by changing the graphics backend in RStudio (Tools > Global Options > General > Graphics > Backend: Cairo) or setting
type = "cairo"
when opening a file to draw on, e.g.Todo:
raster4()
function in Martin Maechler's comment to create the test plot. Use a Cairo device when developing your code.rect()
,grid.rect()
. When everything is working correctly, this should draw on top of the previous border (you might play with line thickness/colour so we can see the overplotting). When something is not working, it may help us work out what is going wrong.png(type = *)
orwindows()
. You may need to enlist helpers to draw the plot on different operating systems. We expect some or all of these to look incorrect due to the existing bug(s)!png()
Share your R code and the 4 images (or as many of the 4 images that you can produce) in a comment on this issue.