Skip to content
Back to formatted view

Raw Message

Message-ID: <loom.20090414T161957-792@post.gmane.org>
Date: 2009-04-14T16:20:54Z
From: Dieter Menne
Subject: Lattice xyplot with two y axis

taz9 <alienz747 <at> gmail.com> writes:

> I have some data which needs to be plotted with lattice.
> 
> library(lattice)
> cars <- c(0.1, 0.3, 0.6, 0.4, 0.9)
> trucks <- c(0.2, 0.5, 0.4, 0.5, 0.1)
> drivers<-c(121,145,167,200, 210)
> year<-c(2005,2006,2007,2008,2009)
> type<-c("local","local","foreign","foreign","foreign")
> xyplot(cars+trucks~year|type, data=df3, type="o")
> 
> Basically, I need to show "drivers" as well on a secondary y-axis. Is this
> possible with lattice and xyplot?
> 

Ugly, therefore not officially supported, but possible:

http://markmail.org/message/zap4t22er3aoqhcz

Omit the data=df3 in your example, otherwise it does not run.

Dieter