Ticket #7498: trac_7498-review.patch

File trac_7498-review.patch, 1.3 KB (added by mhansen, 12 years ago)
  • sage/plot/plot3d/plot_field3d.py

    # HG changeset patch
    # User Mike Hansen <mhansen@gmail.com>
    # Date 1259657991 28800
    # Node ID 3f6b6eb751dfe4730b94e470b84792f927940ae4
    # Parent  b32e9e1dcc4d27a360507d2c9d1ec67b3ccadca9
    [mq]: trac_7498-review.patch
    
    diff --git a/sage/plot/plot3d/plot_field3d.py b/sage/plot/plot3d/plot_field3d.py
    a b  
    1717#*****************************************************************************
    1818
    1919from sage.misc.misc import srange
    20 from matplotlib.cm import get_cmap
    21 from matplotlib.colors import LinearSegmentedColormap
    2220from sage.plot.misc import setup_for_eval_on_grid
    2321from sage.modules.free_module_element import vector
    2422from sage.plot.plot import plot
     
    6664    vectors = [vector((ff(*point), gg(*point), hh(*point))) for point in points]
    6765   
    6866    try:
    69         cm=get_cmap(colors)
     67        from matplotlib.cm import get_cmap
     68        cm = get_cmap(colors)
    7069        assert(cm is not None)
    7170    except (TypeError, AssertionError):
    7271        if isinstance(colors, (list, tuple)):
    73             cm=LinearSegmentedColormap.from_list('mymap',colors)
     72            from matplotlib.colors import LinearSegmentedColormap
     73            cm = LinearSegmentedColormap.from_list('mymap',colors)
    7474        else:
    7575            cm = lambda x: colors
    7676