Skip to content

Instantly share code, notes, and snippets.

@GuangchuangYu
Created February 17, 2012 09:13
Show Gist options
  • Save GuangchuangYu/1852074 to your computer and use it in GitHub Desktop.
Save GuangchuangYu/1852074 to your computer and use it in GitHub Desktop.
draw chinese character Jiong using ggplot2
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("")
@nishuai
Copy link

nishuai commented May 12, 2017

I first thought 'are you kidding??' until I actually run the code lol

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment