[R] help with levelplot()

hadley wickham h.wickham at gmail.com
Wed Jan 23 03:50:33 CET 2008


On Jan 22, 2008 8:39 PM, dxc13 <dxc13 at health.state.ny.us> wrote:
>
> useR's,
>
> I want to create a "movie" of a sin function (from 0 to pi/2) using
> levelplot() in the lattice package.  I basically want to create 20 or so
> plots of the sin function starting with an amplitude of 0 and ending at
> amplitude 1.  By using a loop and plotting these in succession, it will have
> the appearance of a movie or animation.  I believe I know how to do this
> part, but I am having trouble working with the colors.
> I want to use a range of colors starting with light blue (denoting zero) and
> progressively getting darker as the amplitude gets closer to 1 (red color).
> Does anyone know a way to do this?

Have a look at http://had.co.nz/ggplot2/geom_tile.html to see some
ways of doing this with ggplot2.

Hadley

-- 
http://had.co.nz/



More information about the R-help mailing list