Re: 2-D Vector Field scale ?

• To: mathgroup at smc.vnet.net
• Subject: [mg22955] Re: 2-D Vector Field scale ?
• From: "Allan Hayes" <hay at haystack.demon.co.uk>
• Date: Fri, 7 Apr 2000 02:54:37 -0400 (EDT)
• References: <8chboj\$9fc@smc.vnet.net>
• Sender: owner-wri-mathgroup at wolfram.com

```"Krautschik, Chris G" <krautschikc at intel.co.jp> wrote in message
news:8chboj\$9fc at smc.vnet.net...
> Hello All,
>
> I would like to add a scale to a 2-D vector field plot that I have
created.
> The scale legend I would like  to place outside the rectangular vector
field
> area and the scale only needs to support 1 dimension since X/Y have the
same
> scale. As far as I know this is not  directly supported by the
> ListPlotVectorField command. Can such a legend or scale perhaps be
> programmed and therefore added to my graph?
>
> Any ideas on how to proceed would be greatly appreciated.
>
> Regards,
> Chris
>
>

Chris,
We can show scales with ListPlotVectorField

<<Graphics`PlotField`

varray = Table[
{Random[Real, {-0.7, 0.7}],
Random[Real, {-0.7, 0.7}]},
{i, 10}, {j, 10}];

lp=ListPlotVectorField[varray,Frame->True];

For a legend we can  use

<< Graphics`Legend`

Two kinds of legends can be generated:

legendspec1 =
{
{
{Graphics[{Hue[0], Line[{{0, 0}, {1, 0}}]}], "red"},
{Hue[.8], "purple"}
},
LegendPosition -> {0,1}
};

legendspec2 =
{Hue[.7#] &, 5, "min", "max", LegendPosition -> {1, -1}};

lpleg =ShowLegend[lp, legendspec1,legendspec2 ]

The coordinates used for LegendPosition have origen at the center of the
bounding box with hndles that you see when you click the display of lp, and
the unit in both directions is one half of the longest side of this box. The
box is indicated when you click on ithe display of lpleg by a gray frame.

Allan
---------------------
Allan Hayes
Mathematica Training and Consulting
Leicester UK
www.haystack.demon.co.uk
hay at haystack.demon.co.uk
Voice: +44 (0)116 271 4198
Fax: +44 (0)870 164 0565

```

• Prev by Date: Re: Pi == 3 for imprecise values of 3?
• Next by Date: Re: Parallel programming.
• Previous by thread: RE: 2-D Vector Field scale ?
• Next by thread: Pi == 3 for imprecise values of 3?