Is this a bug or not?

u = {{}};
VectorPlot[{1, u^2}, {u, 0, 1}, {z, 0, 0.4}]

enter image description here

The VectorPlot works fine if u = {} or u is cleared. It also works or fails on random-looking things: it works when u = {1, {1, {}}} and fails when u = {1, {{}}} and so forth. By "works," I mean it produces the plot of the vector field $(1,u^2)$ that you get when u is cleared.

Version 12.0, Mac.

  • 5
    $\begingroup$ I think it has to be a bug, based on the line "VectorPlot treats the variables x and y as local, effectively using Block." from the docs. $\endgroup$ – ktm Aug 29 '19 at 20:15
  • 2
    $\begingroup$ There are a handful of particular values for which it fails I could find, include u = "a"; and u = "a"; u = Quantity[1, "Inch"];, among others. $\endgroup$ – ktm Aug 29 '19 at 20:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.