0
$\begingroup$

By using Attributes I can see that the function Plot is not a Listable function.

Attributes[Plot]

{HoldAll,Protected,ReadProtected}

However, why does Plot still allow to take a list of functions as an input as bellow?

Plot[{Sin[x], Cos[x]},{x, 0, 2Pi}]
$\endgroup$
  • 4
    $\begingroup$ When something is Listable, it is threaded over lists. So func[{x1, x2, x3}] evaluates to {func[x1], func[x2], func[x3]} if func is Listable. Plot doesn't behave that way, but returns a single object in return. $\endgroup$ – Jason B. Sep 30 '17 at 3:05
  • 3
    $\begingroup$ Not having a Listable attribute does not imply that a function won't accept lists as arguments. $\endgroup$ – J. M. will be back soon Sep 30 '17 at 3:51

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.