Services & Resources / Wolfram Forums
MathGroup Archive
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2000

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: 2-D Vector Field scale ?

  • To: mathgroup at
  • Subject: [mg22955] Re: 2-D Vector Field scale ?
  • From: "Allan Hayes" <hay at>
  • Date: Fri, 7 Apr 2000 02:54:37 -0400 (EDT)
  • References: <8chboj$>
  • Sender: owner-wri-mathgroup at

"Krautschik, Chris G" <krautschikc at> wrote in message
news:8chboj$9fc at
> Hello All,
> I would like to add a scale to a 2-D vector field plot that I have
> The scale legend I would like  to place outside the rectangular vector
> area and the scale only needs to support 1 dimension since X/Y have the
> 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

We can show scales with ListPlotVectorField


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


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}};

Add them to lp

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 Hayes
Mathematica Training and Consulting
Leicester UK
hay at
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?