sympy / sympy

A computer algebra system written in pure Python
https://sympy.org/
Other
12.97k stars 4.43k forks source link

Error in textplot #6101

Open satels opened 12 years ago

satels commented 12 years ago
In [4]: textplot(t/(t-1), 0-20, 20)

     12 |                                                        
        |                                                        
        |                                                        
        |                                                        
        |                                                        
        |                                                        
        |                                                        
        |                                                        
5.71429 | -------------------------------------------------------
        |                                                        
        |                                                        
        |                                                        
        |                                                        
        |                                                        
        |                               ..                       
        | .....................           .......................
        |                      .......                           
-0.5714 |                             .                          
          -20                    0                          20

In [5]: textplot(t/(t-1), 0-20, 20, 200, 100)
---------------------------------------------------------------------------
ZeroDivisionError                         Traceback (most recent call last)

/srv/kontrolnaya-rabota_ru/<ipython console> in <module>()

/srv/kontrolnaya-rabota_ru/env/src/sympy/sympy/plotting/textplot.pyc in textplot(expr, a, b, W, H)
     25     for x in range(W):
     26         try:
---> 27             y[x] = f(a+(b-a)/float(W)*x)
     28         except TypeError:
     29             y[x] = 0

/usr/lib/pymodules/python2.7/numpy/__init__.pyc in <lambda>(t)

ZeroDivisionError: float division by zero

Original issue for #6101: http://code.google.com/p/sympy/issues/detail?id=3002 Original author: https://code.google.com/u/112786146078013975159/

asmeurer commented 12 years ago
**Status:** Accepted  
**Labels:** Plotting  

Original comment: http://code.google.com/p/sympy/issues/detail?id=3002#c1 Original author: https://code.google.com/u/asmeurer@gmail.com/

asmeurer commented 12 years ago
**Status:** Valid  

Original comment: http://code.google.com/p/sympy/issues/detail?id=3002#c2 Original author: https://code.google.com/u/asmeurer@gmail.com/

Krastanov commented 12 years ago
**Labels:** CodeInCategory-Code  

Original comment: http://code.google.com/p/sympy/issues/detail?id=3002#c3 Original author: https://code.google.com/u/100157245271348669141/

Krastanov commented 12 years ago
**Labels:** CodeInImportedIntoGoogleDocs  

Original comment: http://code.google.com/p/sympy/issues/detail?id=3002#c4 Original author: https://code.google.com/u/100157245271348669141/