Ticket #8082: trac_8082.patch

File trac_8082.patch, 1.2 KB (added by vdelecroix, 11 years ago)
  • sage/plot/plot.py

    # HG changeset patch
    # User Vincent Delecroix <20100.delecroix at gmail.com>
    # Date 1264531168 -3600
    # Node ID bec31f40df51aee882135c605ded0879a586437f
    # Parent  21efb0b3fc474972b5c7f617d99173536a3d79d0
    [mq]: plot_correction.patch
    
    diff -r 21efb0b3fc47 -r bec31f40df51 sage/plot/plot.py
    a b  
    20702070    yields a list of one or two numbers.
    20712071   
    20722072    This function can potentially be very slow for large point sets.
     2073
     2074    TESTS::
     2075
     2076        sage: from sage.plot.plot import xydata_from_point_list
     2077        sage: xydata_from_point_list([CC(0), CC(1)])   # ticket 8082
     2078        ([0.0, 1.0], [0.0, 0.0])
    20732079    """
     2080    from sage.rings.complex_number import ComplexNumber
    20742081    if not isinstance(points, (list,tuple)):
    20752082        try:
    20762083            points = [[float(z) for z in points]]
    20772084        except TypeError:
    20782085            pass
    2079     elif len(points)==2 and not isinstance(points[0], (list,tuple)):
     2086    elif len(points)==2 and not isinstance(points[0],(list,tuple,ComplexNumber)):
    20802087        try:
    20812088            points = [[float(z) for z in points]]
    20822089        except TypeError: