__init__() takes exactly 5 arguments (4 given) error in contour plot

asked 2019-02-13 12:03:37 +0100

I am trying to make a contour plot of a complex valued function. Let say it is g(z).

I have imported the complex root and ContourPlot command by doing following:

from sage.rings.polynomial.complex_roots import complex_roots
from sage.plot.contour_plot import ContourPlot

I have even successfully plot the 3d-Plot, but I encountered an error stating:

__init__() takes exactly 5 arguments (4 given)

My command is:

C=ContourPlot(lambda x,y:float(green(x+y*I)),(-5,5),(-5,5))

It seems that I did not miss the fifth argument, I tried to add in some commands, such as plot_points, but then Sage said it did not expect these commands..

What did I miss? Thank you!!

edit retag flag offensive close merge delete

Comments

Please declare explicitly a function that should be passed to the one or the other contour-plot-function. (I do not have the green function.) Note that in the description of the method (for instance using sage: sage.plot.contour_plot.ContourPlot?? in the sage interpreter, or finding the source on the hard disk) we need arguments like here: C = ContourPlot([[1,3],[2,4]], (1,2), (2,3), options={}) . The version may also help potential answerers.

dan_fulea gravatar imagedan_fulea ( 2019-02-15 18:05:17 +0100 )edit