Created
February 17, 2012 09:13
-
-
Save GuangchuangYu/1852074 to your computer and use it in GitHub Desktop.
draw chinese character Jiong using ggplot2
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
f <- function(x) 1/(x^2-1) | |
x <- seq(-3,3, by=0.001) | |
y <- f(x) | |
d <- data.frame(x=x,y=y) | |
p <- ggplot() | |
p <- p+geom_rect(fill = "white",color="black",size=3, | |
aes(NULL, NULL,xmin=-3, xmax=3, | |
ymin=-3,ymax=3, alpha=0.1)) | |
p <- p + geom_line(data=d, aes(x,y), size=3)+ylim(-3,3) | |
p <- p + theme_bw() + | |
theme(axis.text.x=element_blank(), | |
axis.text.y=element_blank(), | |
legend.position="none", | |
panel.grid.minor=element_blank(), | |
panel.grid.major=element_blank(), | |
panel.background=element_blank(), | |
axis.ticks=element_blank(), | |
panel.border=element_blank()) | |
p <- p+xlab("")+ylab("") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I first thought 'are you kidding??' until I actually run the code lol