View Single Post
Old 05-15-2013, 02:08 AM   #1
kushald
Member
 
Location: Bangalore, India

Join Date: Mar 2013
Posts: 42
Default Rscript plot for y-axis

Hi

I am plotting 2 y-axis graph. I have given the script

pdf("plot.pdf")
gene_lens<- read.table ('check.txt', header=FALSE)
colnames(gene_lens)<- c('gene', 'control', 'IP')
print(gene_lens$gene)
par(mar=c(5,4,4,5)+.1)
plot(gene_lens$gene, gene_lens$control, type='h', xlab='base position', ylim=c(0,1000), ylab='read depth', col="skyblue")
par(new=TRUE)
plot(gene_lens$gene, gene_lens$IP, type='h', xlab='base position', ylim=c(0,1000), ylab='read depth', col="red")
legend("topleft",col=c("skyblue","red"),lty=1,legend=c("control","IP"))

But it gives me y axis with 0, 200, 400, 600, 800, 1000. I just want 0, 500, 1000 to be on the scale. (Basically want to reduce the size of the graph). Kindly suggest any edition.

Thanks
Kushal
kushald is offline   Reply With Quote