Suppose I have a function like the following:
a*x^2 + b*y^2 + c*x + d*y + e = 0
How can I plot the curve defined by this equation? For example for x^2 + y^2 - 1= 0
, I expect to plot a circle.
I found no function to plot such equations. The equation which can be plotted is usually in the form of a polynomial function in respect of x
:
y = a*x^n + ....
and the answers for the other question is:
import numpy as np
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
x = np.arange(-5, 5, 0.25)
y = np.arange(-5, 5, 0.25)
X, Y = np.meshgrid(x, y)
F = 3 + 2*X + 4*X*Y + 5*X*X
fig = plt.figure()
ax = fig.add_subplot(111, projection='3d')
ax.plot_surface(X, Y, F)
plt.show()
Which is a 2d surface in three dimensions, while I need a curve in 2d dimension.