Message Boards Message Boards

0
|
8115 Views
|
4 Replies
|
3 Total Likes
View groups...
Share
Share this post:

How can I make ListVectorPlot to display the vectors starting from the spec

Posted 9 years ago

Looks to me that ListVectorPlot is plotting the vector in such a way that the supplied first point is not the starting point, but rather the middle point. Is it possible to tell ListVectorPlot to start at the supplied first point?

POSTED BY: Janos Lobb
4 Replies
Posted 7 years ago
Posted 9 years ago

Thanks Guys for the replies. Yes, I ended up doing Arrowheads and Arrow.

Table[{Graphics[
   Table[{Arrowheads[Tiny], 
     Arrow[{2*quadrantsize*ijtablelens[[i, j]] - quadrantsize, 
       2*wmlenslet[[n, i, j]]*ijtablelens[[i, j]] - 
        quadrantsize}]}, {i, 1, numoflens}, {j, 1, numoflens}], 
   PlotRegion -> {{0, 1}, {0, 1}}, PlotRange -> All, 
   ImageSize -> Small, PlotLabel -> n  , Frame -> True, 
   AxesOrigin -> {0, 0}], 
  MatrixPlot[wavefr265[[n]], ImageSize -> Small , PlotLabel -> n], 
  ArrayPlot[specklesraw[[n]], ImageSize -> Small , 
   PlotLabel -> n]}, {n, 900, 950}]

The ListVectorPlot in place of Graphics was very similar to this. When I Showed the two on the same canvas I could see clearly that ListVectorPlot was plotting something totally different, although according to documentation the starting point of the vectors should have been the same.

POSTED BY: Janos Lobb
Posted 9 years ago

As Sean points out, ListVectorPlot actually interpolates the provided vectors to a vector field, and then plots a "nice" grid of vectors. The option VectorPoints->All should cause only the specific vectors be plotted, with no need for interpolation. Unfortunately, even though there is no need for interpolation, ListVectorPlot will still enforce the requirement that the input vectors be suitable for interpolation. So there are quite a few cases in which it throws an error without real need. I have submitted a request through tech support that this be remedied in a future release.

Kind regards,

David

POSTED BY: David Keith

I'm not sure I know what you mean. Can you give an example?

ListVectorPlot is often confusing because it tries to smooth out data and show vectors at even intervals. It's very often the case that someone uses the function when they really don't want to be using that function.

Sometimes the answer is to use the option VectorPoints->All:

http://reference.wolfram.com/language/ref/VectorPoints.html

Sometimes it's easier to build your plot with Arrows and Graphics:

Graphics[{Arrowheads[0.02], Flatten@Table[ Arrow[{{x, y}, {x, y} + 0.1 {y, y}}], {x, -3, 3, 0.5}, {y, -3, 3, 0.5}]}, Axes -> True]
POSTED BY: Sean Clarke
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract