Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 1796fe6

Browse files
committed
exposed default color cycle
svn path=/trunk/matplotlib/; revision=4614
1 parent 49499db commit 1796fe6

5 files changed

Lines changed: 8 additions & 60 deletions

File tree

API_CHANGES

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
Removed, dead/experimental ExampleInfo, Namespace and Importer
2+
code from matplotlib/__init__.py
13
0.91.1 Released
24

35
0.91.0 Released

lib/matplotlib/__init__.py

Lines changed: 1 addition & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@
5555
"""
5656
from __future__ import generators
5757

58-
__version__ = '0.91.1'
58+
__version__ = '0.91.2svn'
5959
__revision__ = '$Revision$'
6060
__date__ = '$Date$'
6161

@@ -784,60 +784,3 @@ def tk_window_focus():
784784
verbose.report('platform is %s'%sys.platform)
785785
verbose.report('loaded modules: %s'%sys.modules.keys(), 'debug')
786786

787-
class ExampleInfo:
788-
pass
789-
790-
class ExampleManager:
791-
baseurl = 'http://matplotlib.sf.net'
792-
urls = ['%s/%s'%(baseurl, subdir) for subdir in
793-
( 'examples', 'examples/widgets')]
794-
795-
def get_examples(self):
796-
import urllib, re
797-
rgx = re.compile('.*<A HREF="([^.]+\.py)">.*')
798-
examples = []
799-
for url in urls:
800-
lines = urllib.urlopen(url).readlines()
801-
for line in lines:
802-
m = rgx.match(line)
803-
if m is not None:
804-
examples.append('%s/%s'%(url, m.group(1)))
805-
return examples
806-
807-
def get_info(self, s):
808-
"""
809-
return an ExampleInfo instance from s, the string content of
810-
an example
811-
"""
812-
pass
813-
814-
class Namespace:
815-
"""
816-
A class which takes a list of modules and creates an object with
817-
the module naems at attrs
818-
"""
819-
def __init__(self, namespace):
820-
for k,v in namespace.items():
821-
modname = getattr(v, '__name__', None)
822-
if modname is None: continue
823-
if modname.startswith('matplotlib.'):
824-
self.__dict__[modname.replace('matplotlib.', '')] = v
825-
826-
827-
class Importer:
828-
def __init__(self, modstr):
829-
"""
830-
import a bunch of matplotlib modules listed in modstr into a
831-
single namespace. Eg,
832-
833-
mpl = Importer('artist, cbook, lines, patches')
834-
print mpl.cbook.iterable(1)
835-
"""
836-
for name in modstr.split(','):
837-
name = name.strip()
838-
wholename = '.'.join(['matplotlib', name])
839-
basemod = __import__(wholename)
840-
mod = getattr(basemod, name)
841-
setattr(self, name, mod)
842-
843-

lib/matplotlib/axes.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,13 +152,14 @@ class _process_plot_var_args:
152152
an arbitrary number of x, y, fmt are allowed
153153
"""
154154

155+
defaultColors = ['b','g','r','c','m','y','k']
155156
def __init__(self, axes, command='plot'):
156157
self.axes = axes
157158
self.command = command
158159
self._clear_color_cycle()
159160

160161
def _clear_color_cycle(self):
161-
self.colors = ['b','g','r','c','m','y','k']
162+
self.colors = _process_plot_var_args.defaultColors[:]
162163
# if the default line color is a color format string, move it up
163164
# in the que
164165
try: ind = self.colors.index(rcParams['lines.color'])

lib/matplotlib/image.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -243,6 +243,8 @@ def set_array(self, A):
243243

244244
self.set_data(A)
245245

246+
247+
246248
def set_extent(self, extent):
247249
"""extent is data axes (left, right, bottom, top) for making image plots
248250
"""

matplotlibrc.template

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525

2626
#### CONFIGURATION BEGINS HERE
2727
# the default backend; one of GTK GTKAgg GTKCairo FltkAgg QtAgg TkAgg
28-
# Agg Cairo GD GDK Paint PS PDF SVG Template
28+
# WX WXAgg Agg Cairo GD GDK Paint PS PDF SVG Template
2929
backend : %(backend)s
3030
numerix : %(numerix)s # numpy, Numeric or numarray
3131
#maskedarray : False # True to use external maskedarray module

0 commit comments

Comments
 (0)