Looking through colors.py, I noticed that most of the grey cnames use
the spelling 'gray' (the US standard I think), although 'lightgrey'
shows up as a valid name, while 'lightgray' does not. After looking
around the web a bit for what the correct html names are, I found most
sites display 'gray' and 'grey' as synonymous, for all the different
intensities (darkslate, light, dim, etc).
So, here's a patch that does the same, allowing ColorConverter to accept
both spellings for all the intensities.
Also, just thought I'd point out that, only after using MPL for many
months have I finally noticed that commands like plot() accept 'color'
as a kwarg, which allows far more than just the basic 8 or so single
character color names. What a great feature! I only discovered it
because I had grown annoyed by the lack of an easy way to make stuff
grey. Perhaps the color kwarg and the fact that it takes html names, hex
values, and rgb tuples should be mentioned more explicitly in the
docstrings for some of the more common plotting commands?
Cheers,
Martin
Index: lib/matplotlib/colors.py
===================================================================
--- lib/matplotlib/colors.py (revision 3010)
+++ lib/matplotlib/colors.py (working copy)
@@ -66,6 +66,7 @@
'darkcyan' : '#008B8B',
'darkgoldenrod' : '#B8860B',
'darkgray' : '#A9A9A9',
+ 'darkgrey' : '#A9A9A9',
'darkgreen' : '#006400',
'darkkhaki' : '#BDB76B',
'darkmagenta' : '#8B008B',
@@ -77,11 +78,13 @@
'darkseagreen' : '#8FBC8F',
'darkslateblue' : '#483D8B',
'darkslategray' : '#2F4F4F',
+ 'darkslategrey' : '#2F4F4F',
'darkturquoise' : '#00CED1',
'darkviolet' : '#9400D3',
'deeppink' : '#FF1493',
'deepskyblue' : '#00BFFF',
'dimgray' : '#696969',
+ 'dimgrey' : '#696969',
'dodgerblue' : '#1E90FF',
'firebrick' : '#B22222',
'floralwhite' : '#FFFAF0',
@@ -92,6 +95,7 @@
'gold' : '#FFD700',
'goldenrod' : '#DAA520',
'gray' : '#808080',
+ 'grey' : '#808080',
'green' : '#008000',
'greenyellow' : '#ADFF2F',
'honeydew' : '#F0FFF0',
@@ -109,12 +113,14 @@
'lightcyan' : '#E0FFFF',
'lightgoldenrodyellow' : '#FAFAD2',
'lightgreen' : '#90EE90',
+ 'lightgray' : '#D3D3D3',
'lightgrey' : '#D3D3D3',
'lightpink' : '#FFB6C1',
'lightsalmon' : '#FFA07A',
'lightseagreen' : '#20B2AA',
'lightskyblue' : '#87CEFA',
'lightslategray' : '#778899',
+ 'lightslategrey' : '#778899',
'lightsteelblue' : '#B0C4DE',
'lightyellow' : '#FFFFE0',
'lime' : '#00FF00',
@@ -166,6 +172,7 @@
'skyblue' : '#87CEEB',
'slateblue' : '#6A5ACD',
'slategray' : '#708090',
+ 'slategrey' : '#708090',
'snow' : '#FFFAFA',
'springgreen' : '#00FF7F',
'steelblue' : '#4682B4',
@@ -202,6 +209,7 @@
'forestgreen' : '#228B22',
'seagreen' : '#2E8B57',
'darkslategray' : '#2F4F4F',
+ 'darkslategrey' : '#2F4F4F',
'limegreen' : '#32CD32',
'mediumseagreen' : '#3CB371',
'turquoise' : '#40E0D0',
@@ -215,10 +223,13 @@
'cornflowerblue' : '#6495ED',
'mediumaquamarine' : '#66CDAA',
'dimgray' : '#696969',
+ 'dimgrey' : '#696969',
'slateblue' : '#6A5ACD',
'olivedrab' : '#6B8E23',
'slategray' : '#708090',
+ 'slategrey' : '#708090',
'lightslategray' : '#778899',
+ 'lightslategrey' : '#778899',
'mediumslateblue' : '#7B68EE',
'lawngreen' : '#7CFC00',
'chartreuse' : '#7FFF00',
@@ -227,6 +238,7 @@
'purple' : '#800080',
'olive' : '#808000',
'gray' : '#808080',
+ 'grey' : '#808080',
'skyblue' : '#87CEEB',
'lightskyblue' : '#87CEFA',
'blueviolet' : '#8A2BE2',
@@ -243,6 +255,7 @@
'sienna' : '#A0522D',
'brown' : '#A52A2A',
'darkgray' : '#A9A9A9',
+ 'darkgrey' : '#A9A9A9',
'lightblue' : '#ADD8E6',
'greenyellow' : '#ADFF2F',
'palevioletred' : '#AFEEEE',
@@ -259,6 +272,7 @@
'peru' : '#CD853F',
'chocolate' : '#D2691E',
'tan' : '#D2B48C',
+ 'lightgray' : '#D3D3D3',
'lightgrey' : '#D3D3D3',
'thistle' : '#D8BFD8',
'orchid' : '#DA70D6',
-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier.
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Matplotlib-devel mailing list
Matplotlib-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel