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.Sat, 05 Sep 2020 22:06:16 +0200Plotting in 2Dhttps://ask.sagemath.org/question/53329/plotting-in-2d/I have a question about the plots made by SageMath compared to other CAS.
Why does it make the straight line between the two curves? It's like Sage is plotting the vertical asymptote without the user asking for it.
It does this to all the functions in the form of `1/x`. I have not seen this type of plotting in Mathematica or Desmos, which made me wonder why the difference. Thanks.
sage: f(x) = x^2/(x+1)
sage: plot(f, (x,-3,2),figsize=10, ymax=8,ymin=-8)
or
sage: plot(1/(x+1), (x,-3,2),figsize=10, ymax=8,ymin=-8)Sat, 05 Sep 2020 21:38:59 +0200https://ask.sagemath.org/question/53329/plotting-in-2d/Answer by Emmanuel Charpentier for <p>I have a question about the plots made by SageMath compared to other CAS. </p>
<p>Why does it make the straight line between the two curves? It's like Sage is plotting the vertical asymptote without the user asking for it. </p>
<p>It does this to all the functions in the form of <code>1/x</code>. I have not seen this type of plotting in Mathematica or Desmos, which made me wonder why the difference. Thanks.</p>
<pre><code>sage: f(x) = x^2/(x+1)
sage: plot(f, (x,-3,2),figsize=10, ymax=8,ymin=-8)
</code></pre>
<p>or</p>
<pre><code>sage: plot(1/(x+1), (x,-3,2),figsize=10, ymax=8,ymin=-8)
</code></pre>
https://ask.sagemath.org/question/53329/plotting-in-2d/?answer=53330#post-id-53330Try:
plot(1/(x+1), (x,-3,2),figsize=10, ymax=8,ymin=-8, detect_poles="True")
or (more informative) :
plot(1/(x+1), (x,-3,2),figsize=10, ymax=8,ymin=-8, detect_poles="show")
`plot?` is your friend...Sat, 05 Sep 2020 22:06:16 +0200https://ask.sagemath.org/question/53329/plotting-in-2d/?answer=53330#post-id-53330