Message-ID: <eb555e660904080924p2432e804v7e68d93364d1675c@mail.gmail.com>
Date: 2009-04-08T16:24:44Z
From: Deepayan Sarkar
Subject: vectors on top of contours, and lattice
In-Reply-To: <F99A7BAA16F00E4FB872978F3F99137803A87349@VFGAMLAO13.Enterprise.afmc.ds.af.mil>
On 4/8/09, Cable, Samuel B Civ USAF AFMC AFRL/RVBXI
<Samuel.Cable at hanscom.af.mil> wrote:
> OK, I needed to plot a set of vectors on top of a contour plot. I
> figured out a way to do this. I create a panel function that calls
> "larrows()" with arguments constructed from my vector data. Then, when
> I go to do the contour plot, I call contourplot() with the "panel"
> argument set to point to my newly created panel function.
>
>
>
> So far, so good.
>
>
>
> Now, I need to do a series of contour plots, each overlaid with a
> different set of vectors. I can call contourplot(z~x*y,...) but now
> I'm stuck, because each contour plot will be overlaid with the *same*
> vector plot. This won't work because each set of contoured data has its
> own particular set of associated vector data. (BTW, I am not doing
> gradients here. The vector data is its own entity, not derivable from
> the contoured data.) Can I somehow define a whole series of panel
> functions and coax contourplot() to choose the right one for each of its
> plots? Or do I have to revise my entire approach here?
See ?packet.number for one approach. This should allow you to extract
the correct component of the vector data inside the panel function.
-Deepayan