Sam,

I recommend taking a look at the ggplot2 package. This page from the
author's website contains an example of what I think you are trying to
achieve:

http://had.co.nz/ggplot2/geom_segment.html

Obviously, this would require doing the whole plot in ggplot2, but that's
not at all unpleasant. There's even a mailing list (on Google Groups) from
ggplot2 with lots of friendly people to help.

Best of luck,
Jonathan


On Thu, Jul 22, 2010 at 8:56 AM, Sam Albers <tonightstheni...@gmail.com>wrote:

> Hello,
>
> I am trying to create a plot often seen in hydrodynamic work than includes
> a
> contour plot representing the water speed with arrows pointing in the
> direction of flow. Does anyone have any idea how I might add arrows based
> on
> wf$angle (in the example below) to the plot below?
>
> Thanks in advance!
>
> Sam
>
> library(lattice)
>
> speed <- runif(100, 0, 20)
> wf <- data.frame(speed)
> wf$width <- (1:10)
> wf$length <- rep(1:10, each=10)
> wf$angle <-runif(100, 0, 360)
>
> #How do I add arrows based on wf$angle within each coloured box to
> represent
> the direction of flow?
> #i don't have to use lattice. Just using it as an example.
> with(wf, contourplot(speed ~ width*length,
>                     region=TRUE,
>                     contour=FALSE
>                     ))
>
> --
> *****************************************************
> Sam Albers
> Geography Program
> University of Northern British Columbia
> 3333 University Way
> Prince George, British Columbia
> Canada, V2N 4Z9
> phone: 250 960-6777
> *****************************************************
>
>        [[alternative HTML version deleted]]
>
> ______________________________________________
> R-help@r-project.org 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.
>

        [[alternative HTML version deleted]]

______________________________________________
R-help@r-project.org 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.

Reply via email to