[R] RES: Barplot with "Independent" Lines Y axis

Jim Lemon jim at bitwrit.com.au
Fri Dec 10 11:48:46 CET 2010


On 12/10/2010 08:48 PM, Rodrigo Aluizio wrote:
> OK that's it. Working nicely. I sent the final graph with the note of the
> twoord.plot help attached to it. And some "personal" comments

Hi Rodrigo,
Although I came rather late to this, I might as well show how I did it:

# first I corrected the commas as Peter pointed out
library(plotrix)
par(las=3)
twoord.plot(ly=pluv_sal$Rain,lx=pluv_sal$Salt,mar=c(6,4,4,2),
  xlab="",ylab="Rainfall (mm)",rylab="Salinity",type=c("bar","b"),
  main="Rainfall and salinity",lcol=NA,rcol=2,
  xticklab=pluv_sal$Point,xaxt="n")
par(las=0)
mtext("Month",side=1,at=7,line=3)

You did find a bug in the twoord.plot function, and the next version of 
plotrix will contain one more bug fix, with thanks to you.

Jim



More information about the R-help mailing list