3
$\begingroup$

If I run

StreamPlot[{a, b}, {a, 0, 10}, {b, 0, a}] 

the kernel hangs, and I have to restart it. I also get the error message

StreamPlot::strmpts: Automatic is not a valid StreamPoints specification.

If I try to manually specify StreamPoints, the kernel still hangs, and the error message changes: e.g., with StreamPoints -> 10, I get

StreamPlot::strmpts: 10 is not a valid StreamPoints specification.

(For the record, I'm using 10.4.1 for Microsoft Windows (64-bit)).

What's going on here? What does this message mean, and how can I fix it?

$\endgroup$
2
  • $\begingroup$ same issue in v9 (windows 10/64bit) $\endgroup$ Commented Aug 4, 2019 at 13:41
  • $\begingroup$ Same error with v12 (macOS 10.14.6) $\endgroup$ Commented Aug 4, 2019 at 17:08

2 Answers 2

3
$\begingroup$

No idea why it doesn't work as in Plot3D[ a b , {a, 0, 10}, {b, 0, a}]...

Try RegionFunction

StreamPlot[{a, b}, {a, 0, 10}, {b, 0, 10},RegionFunction -> Function[{a, b}, b < a]] 

enter image description here

$\endgroup$
2
  • $\begingroup$ Thanks! Which version are you using? Mine is 10.4. Can you confirm that the same error happens for v>10.4? $\endgroup$ Commented Aug 4, 2019 at 13:38
  • $\begingroup$ The same error in v11.01! $\endgroup$ Commented Aug 4, 2019 at 13:40
3
$\begingroup$

StreamPlot is not designed to work with such domain specs. It ought to give a better message though. Actually it doesn't seem to validate the domain before sending it to the internal routines. (Probably, it used a standard plot validation, but the internal routines assume the limits are numeric, i.e., that it's a rectangle.)

tr = Trace[ StreamPlot[{a, b}, {a, 0, 10}, {b, 0, a}], _Visualization`VectorFields`VectorFieldsDump`StreamPointsParse, TraceInternal -> True]; 

StreamPlot::strmpts: Automatic is not a valid StreamPoints specification.

Cases[ Flatten@tr, HoldForm[parse_Visualization`VectorFields`VectorFieldsDump`StreamPointsParse] :> parse] 

StreamPlot::strmpts: Automatic is not a valid StreamPoints specification.

(* {None} *) 

One can inspect StreamPointsParse and its subroutines with GeneralUtilities`PrintDefinitions, if one's curious. It's fairly short code and easy to follow.

$\endgroup$

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.