sagemath / sage

Main repository of SageMath
https://www.sagemath.org
Other
1.41k stars 475 forks source link

Asymptote plotting #3985

Open kcrisman opened 16 years ago

kcrisman commented 16 years ago

Still need improvement on plotting of asymptote of e.g. tan or 1/x, especially when detect_poles != True. Ideally one has an output similar to

sage: plot(tan,-20,20).show(ymin=-5, ymax=5) 

but just straight out of plot.

Component: graphics

Issue created by migration from https://trac.sagemath.org/ticket/3985

85eec1a4-3d04-4b4d-b711-d4db03337c41 commented 16 years ago
comment:1

Hmm, I am wondering if #3907 fixed this issue?

Cheers,

Michael

kcrisman commented 16 years ago
comment:2

I doubt it, because e.g. the tangent example above usually won't get 'inf' or '-inf' as something in ydata; it just has weird things happen near asymptotes because of the adaptive plotting, and also will occasionally get random points that are really far from y=0. I'll try it when 3.1.2 comes out, though.

It's actually kind of fun to evaluate the above command again and again, seeing what you get each time... If you try a few times you can get a ydata point that is 10000 or even more, which requires only that plot "guesses" a number within 10-5 of pi/2 for the xdata...

kcrisman commented 15 years ago
comment:3

Just FYI, #6035 partially resolves this.

However,

sage: plot(tan,-20,20, detect_poles='show')
sage: plot(tan,-20,20, detect_poles=True)

shows that 'show' still keeps the "missing" points (which include not just the asymptote but also the high slopes on either side) and that True doesn't create a uniform height as one might desire in the Description.

Description changed to indicate this successful partial resolution, however!

kcrisman commented 15 years ago

Description changed:

--- 
+++ 
@@ -1,7 +1,6 @@
-Plotting functions like 1/x, tan, etc. have asymptotes essentially plotted in Sage at this point.  This is okay, except that the scale is way out of whack, so things look very odd.  Sage should either remove the asymptote piece of these plots somehow (how is not obvious) or fix the ymin and ymax in show so that it just looks like the asymptotes are plotted.  
-E.g.
+Still need improvement on plotting of asymptote of e.g. tan or 1/x, especially when detect_poles != True.  Ideally one has an output similar to

sage: plot(tan,-20,20).show(ymin=-5, ymax=5)

-except automatic detection of the ymin and ymax.
+but just straight out of plot.
kcrisman commented 11 years ago
comment:5

See also #8341.