Skip to content
Prev 277548 / 398506 Next

plotting a double y axis when x and y lengths differ

On 11/16/2011 03:51 PM, Vinny Moriarty wrote:
Hi Vinny,
This is one way to do it:

offset<-0.05
plot(Data1$Year-offset,Data1$Data,type="b",ylim=c(0,110))
points(Data2$Year+offset,Data2$Data,type="b")
dispersion(Data1$Year-offset,Data1$Data,Data1$SE)
dispersion(Data2$Year+offset,Data2$Data,Data2$SE)

Not too elegant, but it gets the job done.

Jim