make outdirs && make -j 2
convertPicture()function in the grConvert package. librsvg was used to read in the SVG image, which is then rendered to the appropriate output format by Cairo.
pdf()device. In the case of grImport2, because it uses SVG as its source image it can use features that are not available in PostScript (e.g. semi-transparency).
pdf()device, we just use the
grImport has been improved to handle rectangle fills and strokes, given this improvement many of the images are now drawn correctly. In addition, the line endings, line join and line mitre properties of strokes are now respected.
All images on this page are just PNG thumbnails from the source images. To view the source images, click on the thumbnail.
The thumbnails for the PDF images were created by the evince-thumbnailer program. For SVG images, inkscape was used instead.
Thumbnails created by evince-thumbnailer appear to exaggerate the strokes on images slightly, so the thumbnails may appear to be slightly incorrect in comparison to the source image (at least for the grImport and grImport2 columns).
Some images cannot be parsed correctly from their SVG form because of the SVG attribute "stroke-dasharray". R's equivalent, "lty" is too restrictive because instead of allowing any non-negative value, it only allows values between 0x1 and 0xF (1 and 15). Furthermore, it only allows a maximum of 8 values, whereas "stroke-dasharray" is does not feature this limitation. This limitation cannot (reasonably) be worked around in R but the image could be "flattened" using other software (and then read in again as Cairo SVG).
There are other features of SVG that are not available in R graphics such as non-rectangular clipping paths, gradients (linear and radial), masks, filters, etc. Consequently, these features cannot be used on a regular R graphics device. We can use gridSVG to enable these features.
/rectstroke). This corrects the rendering of many flags. Additionally, there is now support for more line properties: line endings, line joins, and line mitres.
|State||SVG||grImport||Improved grImport||grImport2||grImport2 + gridSVG||Notes|
|Arizona||This cannot be parsed correctly in its SVG form because the red background is "striped" because of the SVG attribute "stroke-dasharray". R's equivalent, "lty" is too restrictive. See "Known Limitations".|
|Georgia||Features a non-rectangular clipping path.|
|Kansas||Features many linear gradients that comprise the centre of the flag.|
|Nevada||Features radial gradients, but they are so small that their effect is negligible. gridSVG does use the gradients and exports them but the flag appears fine with the radial gradients omitted.|
|Ohio||Features a non-rectangular clipping path.|
|South Carolina||grImport imports and renders this flag, but this is a white foreground on a non-existent blue background. Therefore this appears as white on white.|