Basheer Algohi
Basheer Algohi

Reputation: 127

How to pass more than one function to the sympy.plot

This code works:

import sympy as sy
x = sy.symbols('x')
sy.plot(x, x**2, x**3, (x, -5, 5))

This also works:

fun=x
sy.plot(fun, (x, -5, 5))

This does not work:

fun=x, x**2, x**3
sy.plot(fun, (x, -5, 5))

How to pass more than one function to the plot arg?

Upvotes: 0

Views: 44

Answers (1)

钱治安
钱治安

Reputation: 36

just using sy.plot(*fun, (x, -5, -5)) will be fine. you should unpacking the

Upvotes: 2

Related Questions