3 ms·
Can’t you just export a vector file and then let whatever other renderer (e.g. a browser) handle the antialiasing? Edit: I don’t think I understand your compla
by jacobolus 11y ago
Can’t you just export a vector file and then let whatever other renderer (e.g. a browser) handle the antialiasing?
Edit: I don’t think I understand your complaint. The graphics in the original article are antialiased. Are you just saying their antialiasing algorithm isn’t as good?
Here’s what your version (on the left) looks like when rescaled (using Preview on OS X to rescale) to about the same size as theirs; the two seem roughly comparable:
http://i.imgur.com/LWCeAPj.png http://i.imgur.com/LWCeAPj.png
(I think the reason for the difference in apparent line/font weight in my picture there is that Preview properly downscales in a linear (not gamma-encoded) color space, whereas most vector antialiasing/rasterizing algorithms, including both Quartz and Cairo AFAIK, work in a gamma-encoded space). If you had generated the image at the same original size, I suspect it would look extremely similar to the one in the blog post.
- minimaxir 11y agoWhoops, I figured out what the problem was. I rendered it the way the author did using png("test.png", width=720, height=432) instead of using ggsave(). The resulting image is close to what's in the article. I'll need to look into it more. > Can’t you just export a vector file and then let whatever other renderer (e.g. a browser) handle the antialiasing? You can export as .svg but it's not recommended since .svg support isn't great.
- otsaloma 11y ago> Can’t you just export a vector file and then let whatever other renderer (e.g. a browser) handle the antialiasing? You can. In my experience, for good quality, it's best to output graphics from R as PDF and if you need a rasterized version, do that separately with pdftoppm or something with a dpi chosen based on where it will be shown.