Ask Your Question

Plotting in 2D

asked 2020-09-05 21:38:59 +0200

Alex89 gravatar image

updated 2020-09-05 21:42:28 +0200

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)


sage: plot(1/(x+1), (x,-3,2),figsize=10, ymax=8,ymin=-8)
edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2020-09-05 22:06:16 +0200

Emmanuel Charpentier gravatar image


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...

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower


Asked: 2020-09-05 21:38:59 +0200

Seen: 529 times

Last updated: Sep 05 '20