-
-
Save sainathadapa/11115803 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# On ubuntu, this is needed to compile Cairo: | |
# sudo apt-get install libcairo2-dev | |
# sudo apt-get install libxt-dev | |
# install.packages('Cairo') | |
library(ggplot2) | |
# Regular png | |
png('test1-png.png') | |
ggplot(mtcars, aes(wt, mpg)) + geom_point() | |
dev.off() | |
# png, attempting to use cairo device | |
png('test2-cairo.png', type="cairo") | |
ggplot(mtcars, aes(wt, mpg)) + geom_point() | |
dev.off() | |
# With Cario library | |
library(Cairo) | |
CairoPNG('test3-CairoPNG.png') | |
ggplot(mtcars, aes(wt, mpg)) + geom_point() | |
dev.off() | |
# This successfully antialiases points |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment