Issue
Let's assume I have an equation, such as
10 * x ** 2 - 7 * x + 3 == 2 * y + y ** 2
I want to solve it for y
, then plot y
vs x
for x
from 0 to 1. How do I do that in Python?
I know how to do it in Mathematica but I am migrating to Python. In Mathematica it's just one line
Plot[y /. Solve[10 x^2 - 7 x + 3 == 2 y + y^2, y], {x, 0, 1}]
Solution
With sympy's plot_implicit()
, you can directly draw the equation.
from sympy import symbols, Eq, plot_implicit
x, y = symbols('x y')
plot_implicit(Eq(10 * x ** 2 - 7 * x + 3, 2 * y + y ** 2), (x, -1, 2))
Answered By - JohanC
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.