As a beginner, I am working with plotting using sympy. Is there any way that I can plot a graph using a simple list?
from sympy.plotting import plot
y_vals = [1, 4, 9, 16]
There is an undocumented way to do that.
First, you need to create a List2DSeries
series objects containing the coordinates; then instantiate the Plot
class to create the plot.
from sympy.plotting.plot import List2DSeries, Plot
x_vals = [1, 2, 3, 4]
y_vals = [1, 4, 9, 16]
s = List2DSeries(x_vals, y_vals)
Plot(s).show()
Plot(s, backend="matplotlib").show()
. Do you have matplotlib installed?
May 26 at 7:30
matplotlib