ASKSAGE: Sage Q&A Forum - RSS feedhttps://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Fri, 15 Feb 2019 18:05:17 +0100__init__() takes exactly 5 arguments (4 given) error in contour plothttps://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 12:03:37 +0100https://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>
https://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 18:05:17 +0100https://ask.sagemath.org/question/45446/__init__-takes-exactly-5-arguments-4-given-error-in-contour-plot/?comment=45471#post-id-45471