3
$\begingroup$
VectorPlot[{Exp[x],x}, {x,-5,5}, {y,-5,5}, VectorPoints -> Table[{x,1/x},{x,-5,5,0.1}]] 

The vector at (0,0) shouldn't be there. Why is it drawn?

enter image description here

$\endgroup$
3
  • 3
    $\begingroup$ It would be good, and everyone will appreciate it if you can please provide copyable code. $\endgroup$ Commented Apr 6 at 4:17
  • 2
    $\begingroup$ What version and platform do you use? It work fine in 14.2 version on Mac. $\endgroup$ Commented Apr 6 at 11:09
  • $\begingroup$ @cvgmt i'm using 11 on wins $\endgroup$ Commented Apr 7 at 4:12

1 Answer 1

6
$\begingroup$

The problem lies with your VectorPoints. Your list of points given by following table

Table[{x,1/x},{x,-5,5,0.1}] 

include {0., ComplexInfinity}. You can simply exclude that point.

points = Join[Table[{x, 1/x}, {x, -5, -.1, .1}],Table[{x, 1/x}, {x, .1, 5, .1}]]; VectorPlot[{Exp[x], x}, {x, -5, 5}, {y, -5, 5}, VectorPoints -> points] 

Plot

$\endgroup$
5
  • 2
    $\begingroup$ Table[{x,1/x},{x,-5,5,0.1}] does not contain {0,0}, nor any point close to it. You seem to say it does, right? The point you exclude is {2.77556*10^-16, 3.60288*10^15}, the farthest point from {0,0}, which solves the problem for a reason as yet unexplained. $\endgroup$ Commented Apr 6 at 12:56
  • 1
    $\begingroup$ Maybe I should add that I'm using V14.2.0, since there seems to be a difference in versions. $\endgroup$ Commented Apr 6 at 13:07
  • 2
    $\begingroup$ @MichaelE2 I am so sorry, my bad. I had a typo it should been the point {0.,ComplexInfinity}. $\endgroup$ Commented Apr 6 at 13:35
  • 1
    $\begingroup$ Thanks for the reply. It brought to light a change in how Table[] works, about which I just posted a question. $\endgroup$ Commented Apr 6 at 17:34
  • $\begingroup$ @MichaelE2 upvoted your new Table[] question $\endgroup$ Commented Apr 7 at 4:15

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.