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.Sun, 27 Jan 2019 14:41:53 +0100implicit_plot plot of a listhttps://ask.sagemath.org/question/45196/implicit_plot-plot-of-a-list/ Hello,
On Sage 8.5, Release Date: 2018-12-22, I am doing
`var('x,y')`
`F1 =plot([k/x for k in [-5..5]], (-5, 5), ymin=-5, ymax = 5, detect_poles=True, color="red")`
`F2= implicit_plot([y^2 - x^2 -c for c in [-5..5]], (x,-5,5), (y,-5,5))`
to obtain two families of orthogonal curves. While the first family is ok, there seems to be a problem with the second one.
I can circunvent my problem by doing a lis of plots (instead of the plot of a list), as follows :
`[implicit_plot(y^2 - x^2 -c ==0, (x,-5,5), (y,-5,5), color="blue" ) for c in [-5..5]]`
I was expecting that `plot(...)` and `implicit_plot(...)` would beheave in the same manner in this situation. Why this is not the case? Am I missing something in the syntax?
Regards,
JC
Sun, 27 Jan 2019 04:47:23 +0100https://ask.sagemath.org/question/45196/implicit_plot-plot-of-a-list/Comment by rburing for <p>Hello,</p>
<p>On Sage 8.5, Release Date: 2018-12-22, I am doing </p>
<p><code>var('x,y')</code></p>
<p><code>F1 =plot([k/x for k in [-5..5]], (-5, 5), ymin=-5, ymax = 5, detect_poles=True, color="red")</code></p>
<p><code>F2= implicit_plot([y^2 - x^2 -c for c in [-5..5]], (x,-5,5), (y,-5,5))</code></p>
<p>to obtain two families of orthogonal curves. While the first family is ok, there seems to be a problem with the second one. </p>
<p>I can circunvent my problem by doing a lis of plots (instead of the plot of a list), as follows :</p>
<p><code>[implicit_plot(y^2 - x^2 -c ==0, (x,-5,5), (y,-5,5), color="blue" ) for c in [-5..5]]</code></p>
<p>I was expecting that <code>plot(...)</code> and <code>implicit_plot(...)</code> would beheave in the same manner in this situation. Why this is not the case? Am I missing something in the syntax?</p>
<p>Regards,
JC </p>
https://ask.sagemath.org/question/45196/implicit_plot-plot-of-a-list/?comment=45201#post-id-45201Indeed the interfaces are not consistent (but the documentation is clear: [for `implicit_plot`](http://doc.sagemath.org/html/en/reference/plotting/sage/plot/contour_plot.html#sage.plot.contour_plot.implicit_plot) it states that only one function/equation is accepted). It would be better if they were consistent. This was also requested in [trac ticket #14526](https://trac.sagemath.org/ticket/14526) six years ago.Sun, 27 Jan 2019 14:41:53 +0100https://ask.sagemath.org/question/45196/implicit_plot-plot-of-a-list/?comment=45201#post-id-45201Answer by parzan for <p>Hello,</p>
<p>On Sage 8.5, Release Date: 2018-12-22, I am doing </p>
<p><code>var('x,y')</code></p>
<p><code>F1 =plot([k/x for k in [-5..5]], (-5, 5), ymin=-5, ymax = 5, detect_poles=True, color="red")</code></p>
<p><code>F2= implicit_plot([y^2 - x^2 -c for c in [-5..5]], (x,-5,5), (y,-5,5))</code></p>
<p>to obtain two families of orthogonal curves. While the first family is ok, there seems to be a problem with the second one. </p>
<p>I can circunvent my problem by doing a lis of plots (instead of the plot of a list), as follows :</p>
<p><code>[implicit_plot(y^2 - x^2 -c ==0, (x,-5,5), (y,-5,5), color="blue" ) for c in [-5..5]]</code></p>
<p>I was expecting that <code>plot(...)</code> and <code>implicit_plot(...)</code> would beheave in the same manner in this situation. Why this is not the case? Am I missing something in the syntax?</p>
<p>Regards,
JC </p>
https://ask.sagemath.org/question/45196/implicit_plot-plot-of-a-list/?answer=45199#post-id-45199It seems that `implicit_plot` is not happy about receiving a list of functions.
You can do this:
F2=sum([implicit_plot(y^2 - x^2 -c ==0, (x,-5,5), (y,-5,5), color="blue" ) for c in [-5..5]])
which should work for the purpose of displaying or saving the plot.Sun, 27 Jan 2019 13:40:58 +0100https://ask.sagemath.org/question/45196/implicit_plot-plot-of-a-list/?answer=45199#post-id-45199