0
$\begingroup$

Why are the errors below thrown? They are very strange and seem to be incorrect.

Error 1

ListLinePlot3D[Map[Dynamic, {{1, 2}, {1, 3}}, {2}]]

1

Error 2

ListLinePlot3D[Dynamic[{{1, 2}, {1, 3}}]]

2

  • All three of the following throw no errors and give the correct output.
ListLinePlot3D[{{1, 2}, {1, 3}}]

Dynamic[{{1, 2}, {1, 3}}] 

Dynamic[ListLinePlot3D[{{1, 2}, {1, 3}}]]

Notice the last two include Dynamic applied to a literal, and they work fine with no errors.

So the problem seems to be with ListLinePlot3D[Dynamic[...],...].

Update

I understand a Dynamic on a literal will not do anything. The code here are minimal examples whittled down from more complex and pragmatic code, and the same errors are given when Dynamic is applied to a non-literal. I chose literals to make the minimal examples simplest. The code shown should work, even if Dynamic doesn't do anything useful.

$\endgroup$
8
  • 2
    $\begingroup$ What are you attempting to do? Dynamic on a literal will not do anything because a literal cannot change its value. $\endgroup$
    – Edmund
    Apr 15, 2022 at 0:22
  • $\begingroup$ I’m trying to figure out why these errors are thrown. It doesn’t seem like these errors make sense. The practical function I am using is more complex than this, but I reduced the problem to this. My overall code is of the form ListLinePlot3D[Dynamic[…]]. $\endgroup$ Apr 15, 2022 at 4:47
  • $\begingroup$ @JustSomeOldMan - I don't know if that would work in general, why not Dynamic[ListLinePlot3D[...]]? $\endgroup$
    – Jason B.
    Apr 20, 2022 at 18:40
  • 1
    $\begingroup$ On another topic, nested Dynamics and superfluous Dynamics sometimes end up doing weird things (or at least things that seem weird to me). If you really need a Dynamic, I suggest you put it as far to the "outside" of the expression as possible, ideally the outermost wrapper. Except, of course, in the cases of controls that are specifically designed to take Dynamic expressions as arguments. $\endgroup$
    – lericr
    Apr 20, 2022 at 19:38
  • 2
    $\begingroup$ @JustSomeOldMan The linked topic is not about plots but I think it identifies the culprit here. Let me know if you disagree. $\endgroup$
    – Kuba
    Apr 20, 2022 at 20:04

0