MathGroup Archive 2009

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

Search the Archive

Re: options for VectorPlot in version 7 vs VectorFieldPlot in version 6

  • To: mathgroup at smc.vnet.net
  • Subject: [mg104131] Re: options for VectorPlot in version 7 vs VectorFieldPlot in version 6
  • From: "David Park" <djmpark at comcast.net>
  • Date: Tue, 20 Oct 2009 04:53:16 -0400 (EDT)
  • References: <19419092.1255952174136.JavaMail.root@n11>

I'm sure WRI has a way, but it is very difficult to find a Help example that
doesn't have the same x and y scale.

If you don't get a better answer you could try something like this:

points = Flatten[Table[{x, y}, {x, -5, 75, 5}, {y, 0, 2500, 250}], 1];

arrow[{x_, y_}] := 
 Arrow[{{x, y}, {x, y} + Normalize[{f[x, y], g[x, y]}]}]

Graphics[{Arrowheads[.03], arrow /@ points},
 AspectRatio -> 1,
 PlotRange -> {{-10, 80}, {-200, 2700}},
 Frame -> True]


David Park
djmpark at comcast.net
http://home.comcast.net/~djmpark/  






From: janey [mailto:janemkiwi at gmail.com] 

Dear Mathematica Usenet Group,

I have been having a lot of problems with finding appropriate options
in Version 7 for VectorPlot that give an acceptable, viewable plot
when scales on the horizontal and vertical axes are different (I am
trying to get predator prey phase portraits, plotting population of
predator vs population of prey; obviously there are far more prey than
predators).

My only solution so far has been to put up with the complaints from
using
<< VectorFieldPlots`
about the version 6 legacy version.

For example, the following works just fine (apart from annoying
warnings) in version 7 given that it uses the version 6 command
VectorFieldPlot in place of version 7's VectorPlot:

<< VectorFieldPlots`;

f[x_, y_] = -.05 x + .0001 x y; g[x_, y_] = .1 y - .005 x y;

field = VectorFieldPlot[{f[x, y], g[x, y]}, {x, 1, 70}, {y, 0, 2400},
  PlotPoints -> {15, 15}, Frame -> True, AspectRatio -> 1]

With Version 7's VectorPlot, although I can specify the number of
arrows to be shown with VectorPoints replacing PlotPoints, I have not
been able to set VectorScale to give me anywhere near an acceptable
plot.

So  in version 7,

f[x_, y_] = -.05 x + .0001 x y; g[x_, y_] = .1 y - .005 x y;

field = VectorPlot[{f[x, y], g[x, y]}, {x, 1, 70}, {y, 0, 2400},
  VectorPoints -> {15, 15}, Frame -> True, AspectRatio -> 1]

looks very bad.

Is there some source of information for manipulating these options
somewhere besides the Mathematica Documentation Center's minimalist
examples? If not, is anyone willing to share how to get success with
this?


Any help you can give me would be much appreciated,
thanks
Janey.




  • Prev by Date: Re: Generic Mapping Tools and Mathematica
  • Next by Date: Re: Multi-Colored Filling in DateListPlot
  • Previous by thread: options for VectorPlot in version 7 vs VectorFieldPlot in version 6
  • Next by thread: Re: Point on sphere greatest distance from given