On 12/20/06, John Hunter <[EMAIL PROTECTED]> wrote:
>>>>> "Tim" == Tim Leslie <[EMAIL PROTECTED]> writes:
Tim> colormaps. My question is, how should the output of
Tim> boilerplate.py be included into pylab.py? Should I just cut
Tim> and paste the output, or is there some automagic tool for
Tim> doing it?
Yep, just cut the stuff below
### Do not edit below this point
and paste in the boilerplate output.
Thanks, that all seems to have worked fine. I've attached the patch
with this email.
John, I was wondering if I have svn write access. I seem to recall I
had it a year or two ago, but I can't find any evidence to back this
up, so maybe I'm mistaken. Could you check for me?
Cheers,
Tim
JDH
Index: lib/matplotlib/_cm.py
===================================================================
--- lib/matplotlib/_cm.py (revision 2941)
+++ lib/matplotlib/_cm.py (working copy)
@@ -14,6 +14,7 @@
+
_bone_data = {'red': ((0., 0., 0.),(1.0, 1.0, 1.0)),
'green': ((0., 0., 0.),(1.0, 1.0, 1.0)),
'blue': ((0., 0., 0.),(1.0, 1.0, 1.0))}
@@ -338,6 +339,41 @@
'green': ((0., 0., 0.),(1.0, 1.0, 1.0)),
'blue': ((0., 1., 1.),(1.0, 0.5, 0.5))}
+_spectral_data = {'red': [(0.0, 0.0, 0.0), (0.05, 0.4667, 0.4667),
+ (0.10, 0.5333, 0.5333), (0.15, 0.0, 0.0),
+ (0.20, 0.0, 0.0), (0.25, 0.0, 0.0),
+ (0.30, 0.0, 0.0), (0.35, 0.0, 0.0),
+ (0.40, 0.0, 0.0), (0.45, 0.0, 0.0),
+ (0.50, 0.0, 0.0), (0.55, 0.0, 0.0),
+ (0.60, 0.0, 0.0), (0.65, 0.7333, 0.7333),
+ (0.70, 0.9333, 0.9333), (0.75, 1.0, 1.0),
+ (0.80, 1.0, 1.0), (0.85, 1.0, 1.0),
+ (0.90, 0.8667, 0.8667), (0.95, 0.80, 0.80),
+ (1.0, 0.80, 0.80)],
+ 'green': [(0.0, 0.0, 0.0), (0.05, 0.0, 0.0),
+ (0.10, 0.0, 0.0), (0.15, 0.0, 0.0),
+ (0.20, 0.0, 0.0), (0.25, 0.4667, 0.4667),
+ (0.30, 0.6000, 0.6000), (0.35, 0.6667, 0.6667),
+ (0.40, 0.6667, 0.6667), (0.45, 0.6000, 0.6000),
+ (0.50, 0.7333, 0.7333), (0.55, 0.8667, 0.8667),
+ (0.60, 1.0, 1.0), (0.65, 1.0, 1.0),
+ (0.70, 0.9333, 0.9333), (0.75, 0.8000, 0.8000),
+ (0.80, 0.6000, 0.6000), (0.85, 0.0, 0.0),
+ (0.90, 0.0, 0.0), (0.95, 0.0, 0.0),
+ (1.0, 0.80, 0.80)],
+ 'blue': [(0.0, 0.0, 0.0), (0.05, 0.5333, 0.5333),
+ (0.10, 0.6000, 0.6000), (0.15, 0.6667, 0.6667),
+ (0.20, 0.8667, 0.8667), (0.25, 0.8667, 0.8667),
+ (0.30, 0.8667, 0.8667), (0.35, 0.6667, 0.6667),
+ (0.40, 0.5333, 0.5333), (0.45, 0.0, 0.0),
+ (0.5, 0.0, 0.0), (0.55, 0.0, 0.0),
+ (0.60, 0.0, 0.0), (0.65, 0.0, 0.0),
+ (0.70, 0.0, 0.0), (0.75, 0.0, 0.0),
+ (0.80, 0.0, 0.0), (0.85, 0.0, 0.0),
+ (0.90, 0.0, 0.0), (0.95, 0.0, 0.0),
+ (1.0, 0.80, 0.80)]}
+
+
autumn = colors.LinearSegmentedColormap('autumn', _autumn_data, LUTSIZE)
bone = colors.LinearSegmentedColormap('bone ', _bone_data, LUTSIZE)
cool = colors.LinearSegmentedColormap('cool', _cool_data, LUTSIZE)
@@ -352,10 +388,10 @@
spring = colors.LinearSegmentedColormap('spring', _spring_data, LUTSIZE)
summer = colors.LinearSegmentedColormap('summer', _summer_data, LUTSIZE)
winter = colors.LinearSegmentedColormap('winter', _winter_data, LUTSIZE)
+spectral = colors.LinearSegmentedColormap('spectral', _spectral_data, LUTSIZE)
-
datad = {
'autumn': _autumn_data,
'bone': _bone_data,
@@ -370,7 +406,8 @@
'prism': _prism_data,
'spring': _spring_data,
'summer': _summer_data,
- 'winter': _winter_data
+ 'winter': _winter_data,
+ 'spectral': _spectral_data
}
# 34 colormaps based on color specifications and designs
Index: lib/matplotlib/pylab.py
===================================================================
--- lib/matplotlib/pylab.py (revision 2941)
+++ lib/matplotlib/pylab.py (working copy)
@@ -102,6 +102,7 @@
spring - set the default colormap to spring
summer - set the default colormap to summer
winter - set the default colormap to winter
+ spectral - set the default colormap to spectral
_Event handling
@@ -513,6 +514,7 @@
spring - set the default colormap to spring
summer - set the default colormap to summer
winter - set the default colormap to winter
+ spectral - set the default colormap to spectral
"""
pass
@@ -522,7 +524,7 @@
matplotlib provides the following colormaps.
autumn bone cool copper flag gray hot hsv jet pink prism
- spring summer winter
+ spring summer winter spectral
You can set the colormap for an image, pcolor, scatter, etc,
either as a keyword argumentdef con
@@ -1558,7 +1560,7 @@
except:
hold(b)
raise
-
+
hold(b)
return ret
if Axes.arrow.__doc__ is not None:
@@ -1579,7 +1581,7 @@
except:
hold(b)
raise
-
+
hold(b)
return ret
if Axes.axhline.__doc__ is not None:
@@ -1600,7 +1602,7 @@
except:
hold(b)
raise
-
+
hold(b)
return ret
if Axes.axhspan.__doc__ is not None:
@@ -1621,7 +1623,7 @@
except:
hold(b)
raise
-
+
hold(b)
return ret
if Axes.axvline.__doc__ is not None:
@@ -1642,7 +1644,7 @@
except:
hold(b)
raise
-
+
hold(b)
return ret
if Axes.axvspan.__doc__ is not None:
@@ -1663,7 +1665,7 @@
except:
hold(b)
raise
-
+
hold(b)
return ret
if Axes.bar.__doc__ is not None:
@@ -1684,7 +1686,7 @@
except:
hold(b)
raise
-
+
hold(b)
return ret
if Axes.barh.__doc__ is not None:
@@ -1705,7 +1707,7 @@
except:
hold(b)
raise
-
+
hold(b)
return ret
if Axes.broken_barh.__doc__ is not None:
@@ -1726,7 +1728,7 @@
except:
hold(b)
raise
-
+
hold(b)
return ret
if Axes.boxplot.__doc__ is not None:
@@ -1747,7 +1749,7 @@
except:
hold(b)
raise
-
+
hold(b)
return ret
if Axes.cohere.__doc__ is not None:
@@ -1768,7 +1770,7 @@
except:
hold(b)
raise
-
+
hold(b)
return ret
if Axes.clabel.__doc__ is not None:
@@ -1831,7 +1833,7 @@
except:
hold(b)
raise
-
+
hold(b)
return ret
if Axes.csd.__doc__ is not None:
@@ -1852,7 +1854,7 @@
except:
hold(b)
raise
-
+
hold(b)
return ret
if Axes.errorbar.__doc__ is not None:
@@ -1873,7 +1875,7 @@
except:
hold(b)
raise
-
+
hold(b)
return ret
if Axes.fill.__doc__ is not None:
@@ -1894,7 +1896,7 @@
except:
hold(b)
raise
-
+
hold(b)
return ret
if Axes.hist.__doc__ is not None:
@@ -1915,7 +1917,7 @@
except:
hold(b)
raise
-
+
hold(b)
return ret
if Axes.hlines.__doc__ is not None:
@@ -1957,7 +1959,7 @@
except:
hold(b)
raise
-
+
hold(b)
return ret
if Axes.loglog.__doc__ is not None:
@@ -2020,7 +2022,7 @@
except:
hold(b)
raise
-
+
hold(b)
return ret
if Axes.pie.__doc__ is not None:
@@ -2041,7 +2043,7 @@
except:
hold(b)
raise
-
+
hold(b)
return ret
if Axes.plot.__doc__ is not None:
@@ -2062,7 +2064,7 @@
except:
hold(b)
raise
-
+
hold(b)
return ret
if Axes.plot_date.__doc__ is not None:
@@ -2083,7 +2085,7 @@
except:
hold(b)
raise
-
+
hold(b)
return ret
if Axes.psd.__doc__ is not None:
@@ -2125,7 +2127,7 @@
except:
hold(b)
raise
-
+
hold(b)
return ret
if Axes.semilogx.__doc__ is not None:
@@ -2146,7 +2148,7 @@
except:
hold(b)
raise
-
+
hold(b)
return ret
if Axes.semilogy.__doc__ is not None:
@@ -2209,7 +2211,7 @@
except:
hold(b)
raise
-
+
hold(b)
return ret
if Axes.stem.__doc__ is not None:
@@ -2230,7 +2232,7 @@
except:
hold(b)
raise
-
+
hold(b)
return ret
if Axes.vlines.__doc__ is not None:
@@ -2293,7 +2295,7 @@
except:
hold(b)
raise
-
+
hold(b)
return ret
if Axes.quiverkey.__doc__ is not None:
@@ -2542,4 +2544,16 @@
draw_if_interactive()
+# This function was autogenerated by boilerplate.py. Do not edit as
+# changes will be lost
+def spectral():
+ 'set the default colormap to spectral and apply to current image if any. See help(colormaps) for more information'
+ rc('image', cmap='spectral')
+ im = gci()
+
+ if im is not None:
+ im.set_cmap(cm.spectral)
+ draw_if_interactive()
+
+
Index: boilerplate.py
===================================================================
--- boilerplate.py (revision 2941)
+++ boilerplate.py (working copy)
@@ -153,6 +153,7 @@
'spring',
'summer',
'winter',
+ 'spectral'
)
# add all the colormaps (autumn, hsv, ....)
for name in cmaps:
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Matplotlib-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel