ASKSAGE: Sage Q&A Forum - Individual question feedhttp://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Fri, 15 Feb 2019 11:05:17 -0600__init__() takes exactly 5 arguments (4 given) error in contour plothttp://ask.sagemath.org/question/45446/__init__-takes-exactly-5-arguments-4-given-error-in-contour-plot/ 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!!Wed, 13 Feb 2019 05:03:37 -0600http://ask.sagemath.org/question/45446/__init__-takes-exactly-5-arguments-4-given-error-in-contour-plot/Comment by dan_fulea for <p>I am trying to make a contour plot of a complex valued function. Let say it is g(z).</p>
<p>I have imported the complex root and ContourPlot command by doing following:</p>
<pre><code>from sage.rings.polynomial.complex_roots import complex_roots
from sage.plot.contour_plot import ContourPlot
</code></pre>
<p>I have even successfully plot the 3d-Plot, but I encountered an error stating:</p>
<pre><code>__init__() takes exactly 5 arguments (4 given)
</code></pre>
<p>My command is:</p>
<pre><code>C=ContourPlot(lambda x,y:float(green(x+y*I)),(-5,5),(-5,5))
</code></pre>
<p>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..</p>
<p>What did I miss? Thank you!!</p>
http://ask.sagemath.org/question/45446/__init__-takes-exactly-5-arguments-4-given-error-in-contour-plot/?comment=45471#post-id-45471Please 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.Fri, 15 Feb 2019 11:05:17 -0600http://ask.sagemath.org/question/45446/__init__-takes-exactly-5-arguments-4-given-error-in-contour-plot/?comment=45471#post-id-45471