Revision: 5040
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5040&view=rev
Author: efiring
Date: 2008-04-12 11:48:37 -0700 (Sat, 12 Apr 2008)
Log Message:
-----------
Bugfix and docstring addition for ListedColormap
Modified Paths:
--------------
trunk/matplotlib/lib/matplotlib/colors.py
Modified: trunk/matplotlib/lib/matplotlib/colors.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/colors.py 2008-04-11 15:32:03 UTC (rev
5039)
+++ trunk/matplotlib/lib/matplotlib/colors.py 2008-04-12 18:48:37 UTC (rev
5040)
@@ -530,6 +530,15 @@
"""
def __init__(self, colors, name = 'from_list', N = None):
"""
+ Make a colormap from a list of colors.
+
+ colors is a list of matplotlib color specifications
+ name is a string to identify the colormap
+ N is the number of entries in the map. The default is None,
+ in which case there is one colormap entry for each
+ element in the list of colors. If N < len(colors)
+ the list will be truncated at N. If N > len(colors),
+ the list will be extended by repetition.
"""
self.colors = colors
self.monochrome = False # True only if all colors in map are
identical;
@@ -545,7 +554,7 @@
self.monochrome = True
if len(self.colors) < N:
self.colors = list(self.colors) * N
- del(self.colors[N:])
+ del(self.colors[N:])
else:
try: gray = float(self.colors)
except TypeError: pass
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference
Don't miss this year's exciting event. There's still time to save $100.
Use priority code J8TL2D2.
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
_______________________________________________
Matplotlib-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-checkins