Thursday, September 13, 2012

plot multiple axis in one graph and save in R


The useful blog I found is the following:

plot multiple axis in one graph in R


The basic idea is
1<code>> plot  <-- first plot
2 
3> par(new=T)   <-- tell R to overwrite the first plot
4 
5> plot( ..., axes=F, ... )   <-- plot our second plot, but don't touch the axes
6</code

Also, another trick when plotting a graph first, and then save to file is the following:

plot(...)
dev.copy(svg,"*.svg")
dev.off()

http://statistics.berkeley.edu/classes/s133/saving.html

No comments:

Post a Comment

How to rename files in linux (regular expression)

Here is a very useful link to this question, just need to download their perl script and then use perl regular expression to rename file!! ...