14
$\begingroup$

Bug introduced in 10.0.0 and persisting through 13.2.0 or later.


Consider the following code:

f[t_, y_] := t + y;
VectorPlot[(#1/Norm[#1] &)[{1, f[t, y]}], {t, -3, 3}, {y, -3, 3},
 Frame -> False, Axes -> True, AxesLabel -> {t, y},
 VectorPoints -> 11,
 VectorScale -> Tiny,
 VectorStyle -> {"Segment", GrayLevel[0.5]}
 ]

But I only get 10 by 10 vectors instead of 11 by 11. Is this a bug?

enter image description here

$\endgroup$
6
  • 1
    $\begingroup$ i get the expected output (11 by 11 vector points) in version 9 (Windows 8 64bit). In version 10, something strange is happening with VectorPoints->11 -- other values seem to work fine. $\endgroup$
    – kglr
    Commented Jan 16, 2015 at 5:31
  • 2
    $\begingroup$ Try with {t, -4, 4}, {y, -4, 4}. Is the result as expected? $\endgroup$
    – user9660
    Commented Jan 16, 2015 at 8:20
  • 1
    $\begingroup$ Desired result in v8.0.4 and v9.0.1. I think it's reasonable to consider it as a bug. $\endgroup$
    – xzczd
    Commented Jan 17, 2015 at 3:43
  • $\begingroup$ Interestingly this works on 10.0.1 but is broken again on 10.0.2 $\endgroup$ Commented Jan 19, 2015 at 8:20
  • $\begingroup$ related 73950. $\endgroup$
    – Kuba
    Commented Feb 28, 2016 at 9:49

1 Answer 1

2
$\begingroup$

In version 13.2.0 if we grab the code from the O.P we get $11 \times 12$. The work-around that was suggested in the comments, i.e change {t, -3, 3}, {y, -3, 3} to {t, -4, 4},{y, -4, 4} also does not work in this version; I checked that it works fine in 12.0. The following gives $11 \times 11$ vectors.

Note that the following work-around is for v13.2 and for v13.1.

f[t_, y_] := t + y;
VectorPlot[
 (#1/Norm[#1] &)[{1, f[t, y]}],
 {t, -3, 3},
 {y, -3, 3},
 Frame -> False,
 Axes -> True,
 AxesLabel -> {t, y},
 VectorPoints -> {11,11},
 VectorScale -> Tiny,
 VectorStyle -> {"Segment", GrayLevel[0.5]}]

plot

The following work-around is for v12.0. It has, also, been suggested in the comments for earlier versions.

f[t_, y_] := t + y;
VectorPlot[
 (#1/Norm[#1] &)[{1, f[t, y]}],
 {t, -4, 4},
 {y, -4, 4},
 Frame -> False,
 Axes -> True,
 AxesLabel -> {t, y},
 VectorPoints -> 11,
 VectorScale -> Tiny,
 VectorStyle -> {"Segment", GrayLevel[0.5]}]

v12

Neither of the work-arounds presented above works in v13.0

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.