Re: [R] Plot with two seperate y axis
Thorsten Muehge wrote: Hello, I would like to plot the following matrix: Wk=x achsis. Para 1 = left y-axis as a barplot para 2 right y-axis as a normal scatter plat. I could not find such a solution in any of my documentation. Can someone help me? Thanks a lot Thorsten WkPara 1 Para 2 312000 99.8 322005 99.0 332002 98.0 341090 98.5 352001 99.1 362010 97.0 372010 98.8 Hi Thorsten, Is this what you mean? par(mar=c(5,4,4,4)) xpos-barplot(mueghe.df$Para.1) axis(1,at=xpos,labels=mueghe.df$Wk) par(new=TRUE) plot(xpos,mueghe.df$Para.2,xlim=par(usr)[1:2],xaxs=i, ylim=c(0,100),type=n,xlab=,ylab=,axes=FALSE) axis(4) points(xpos,mueghe.df$Para.2) Jim __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] Plot with two seperate y axis
Hello, I would like to plot the following matrix: Wk=x achsis. Para 1 = left y-axis as a barplot para 2 right y-axis as a normal scatter plat. I could not find such a solution in any of my documentation. Can someone help me? Thanks a lot Thorsten WkPara 1 Para 2 312000 99.8 322005 99.0 332002 98.0 341090 98.5 352001 99.1 362010 97.0 372010 98.8 __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] Plot with two seperate y axis
Assuming the data are in a data frame called dt, this should work: plot(dt$Wk,dt$Para1,type=h) par(new=TRUE) plot(dt$Wk,dt$Para2,yaxt=n) axis(4,at=97:100) On 24/11/06, Thorsten Muehge [EMAIL PROTECTED] wrote: Hello, I would like to plot the following matrix: Wk=x achsis. Para 1 = left y-axis as a barplot para 2 right y-axis as a normal scatter plat. I could not find such a solution in any of my documentation. Can someone help me? Thanks a lot Thorsten WkPara 1 Para 2 312000 99.8 322005 99.0 332002 98.0 341090 98.5 352001 99.1 362010 97.0 372010 98.8 __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. -- = David Barron Said Business School University of Oxford Park End Street Oxford OX1 1HP __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.