Changeset 7888:d12fcefadeb1


Ignore:
Timestamp:
12/23/07 08:08:11 (5 years ago)
Author:
William Stein <wstein@…>
Branch:
default
Message:

Fix for plotting issue.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sage/plot/plot.py

    r7867 r7888  
    17011701                pass 
    17021702 
     1703        try: 
     1704            if len(points) > 0 and len(points[0]) == 3: 
     1705                return self._graphic3d()(points, coerce=coerce, **kwds) 
     1706        except (AttributeError, TypeError): 
     1707            pass 
    17031708        xdata = [] 
    17041709        ydata = [] 
    17051710        if coerce: 
    1706             for z in points: 
    1707                 if len(z) == 3: 
    1708                     return self._graphic3d()(points, coerce=coerce, **kwds) 
    1709                 xdata.append(float(z[0])) 
    1710                 ydata.append(float(z[1])) 
     1711            xdata = [float(z[0]) for z in points] 
     1712            ydata = [float(z[1]) for z in points]             
    17111713        else: 
    1712             for z in points: 
    1713                 if len(z) == 3: 
    1714                     return self._graphic3d()(points, coerce=coerce, **kwds) 
    1715                 xdata.append(z[0]) 
    1716                 ydata.append(z[1]) 
     1714            xdata = [z[0] for z in points] 
     1715            ydata = [z[1] for z in points]             
    17171716 
    17181717        return self._from_xdata_ydata(xdata, ydata, True, options=options) 
     
    19451944        sage: p = line(L, rgbcolor=(1/4,1/8,3/4)) 
    19461945        sage: p.show() 
     1946 
     1947    A line with 2 complex points: 
     1948        sage: i = CC.0 
     1949        sage: show(line([1+i, 2+3*i])) 
    19471950  
    19481951    A blue hypotrochoid (3 leaves): 
    1949   
    19501952        sage: n = 4; h = 3; b = 2 
    19511953        sage: L = [[n*cos(pi*i/100)+h*cos((n/b)*pi*i/100),n*sin(pi*i/100)-h*sin((n/b)*pi*i/100)] for i in range(200)] 
Note: See TracChangeset for help on using the changeset viewer.