#4384: Axes computation for constant function causes division by zero
----------------------+-----------------------------------------------------
Reporter: rbeezer | Owner: somebody
Type: defect | Status: new
Priority: minor | Milestone: sage-3.2.1
Component: notebook | Keywords: plot contant ZeroDivisionError
----------------------+-----------------------------------------------------
For a function which is constant, but not obviously so, it would appear
that some computation for laying out the axis creates a step size of 0
(tick marks on the vertical axis?).
{{{
sage: h=plot(sin(x)^2+cos(x)^2, -6, 6)
sage: show(h)
}}}
{{{
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/rob/.sage/sage_notebook/worksheets/admin/48/code/6.py", line
8, in <module>
show(h)
File "/opt/sage-3.1.4/local/lib/python2.5/site-
packages/SQLAlchemy-0.4.6-py2.5.egg/", line 1, in <module>
File "/opt/sage-3.1.4/local/lib/python2.5/site-
packages/sage/misc/functional.py", line 882, in show
return x.show(*args, **kwds)
File "/opt/sage-3.1.4/local/lib/python2.5/site-
packages/sage/plot/plot.py", line 1350, in show
hgridlinesstyle=hgridlinesstyle)
File "/opt/sage-3.1.4/local/lib/python2.5/site-
packages/sage/plot/plot.py", line 1547, in save
xmin, xmax, ymin, ymax = sage_axes.add_xy_axes(subplot, xmin, xmax,
ymin, ymax)
File "/opt/sage-3.1.4/local/lib/python2.5/site-
packages/sage/plot/axes.py", line 325, in add_xy_axes
x_axis_ypos, ystep, ytslminor, ytslmajor = self._find_axes(ymin, ymax)
File "/opt/sage-3.1.4/local/lib/python2.5/site-
packages/sage/plot/axes.py", line 239, in _find_axes
tslmajor, oppaxis, step = self._tasteless_ticks(minval, maxval, 10)
File "/opt/sage-3.1.4/local/lib/python2.5/site-
packages/sage/plot/axes.py", line 217, in _tasteless_ticks
tslmajor = sage.misc.misc.srange(minval, minval+(num_pieces+1)*step,
step)
File "/opt/sage-3.1.4/local/lib/python2.5/site-
packages/sage/misc/misc.py", line 710, in srange
count = int(math.ceil((float((end-start)/step))))
ZeroDivisionError: float division
}}}
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/4384>
Sage <http://sagemath.org/>
Sage - Open Source Mathematical Software: Building the Car Instead of
Reinventing the Wheel
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"sage-trac" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/sage-trac?hl=en
-~----------~----~----~----~------~----~------~--~---