Skip to content

Commit b4e4ad6

Browse files
committed
Factored plotting part of pylab.py into pyplot.py
svn path=/trunk/matplotlib/; revision=3819
1 parent 42725bf commit b4e4ad6

File tree

11 files changed

+2482
-2451
lines changed

11 files changed

+2482
-2451
lines changed

CHANGELOG

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
1+
2007-09-09 Split out the plotting part of pylab and put it in
2+
pyplot.py; removed numerix from the remaining pylab.py,
3+
which imports everything from pyplot.py. The intention
4+
is that apart from cleanups, the result of importing
5+
from pylab is nearly unchanged, but there is the
6+
new alternative of importing from pyplot to get
7+
the state-engine graphics without all the numeric
8+
functions. - EF
9+
110
2007-09-08 Eliminated gd and paint backends - EF
211

312
2007-09-06 .bmp file format is now longer an alias for .raw
@@ -8,12 +17,12 @@
817
Now it doesn't crash Preview.app. - JKS
918

1019
2007-09-06 Refactored image saving code so that all GUI backends can
11-
save most image types. See FILETYPES for a matrix of
12-
backends and their supported file types.
13-
Backend canvases should no longer write their own print_figure()
14-
method -- instead they should write a print_xxx method for
15-
each filetype they can output and add an entry to their
16-
class-scoped filetypes dictionary. - MGD
20+
save most image types. See FILETYPES for a matrix of
21+
backends and their supported file types.
22+
Backend canvases should no longer write their own print_figure()
23+
method -- instead they should write a print_xxx method for
24+
each filetype they can output and add an entry to their
25+
class-scoped filetypes dictionary. - MGD
1726

1827
2007-09-05 Fixed Qt version reporting in setupext.py - DSD
1928

boilerplate.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ def %(func)s(*args, **kwargs):
2929
return ret
3030
if Axes.%(func)s.__doc__ is not None:
3131
%(func)s.__doc__ = dedent(Axes.%(func)s.__doc__) + \"\"\"
32-
Addition kwargs: hold = [True|False] overrides default hold state\"\"\"
32+
Additional kwargs: hold = [True|False] overrides default hold state\"\"\"
3333
"""
3434

3535
_fmtmisc = """\
@@ -74,6 +74,8 @@ def %(func)s(*args, **kwargs):
7474
'plot',
7575
'plot_date',
7676
'psd',
77+
'quiver',
78+
'quiverkey',
7779
'scatter',
7880
'semilogx',
7981
'semilogy',
@@ -82,8 +84,6 @@ def %(func)s(*args, **kwargs):
8284
'stem',
8385
'step',
8486
'vlines',
85-
'quiver',
86-
'quiverkey',
8787
'xcorr',
8888
)
8989

@@ -104,7 +104,6 @@ def %(func)s(*args, **kwargs):
104104
'pcolormesh' : 'gci._current = ret',
105105
'imshow' : 'gci._current = ret',
106106
'spy' : 'gci._current = ret',
107-
'quiver2' : 'gci._current = ret',
108107
'quiver' : 'gci._current = ret',
109108
'specgram' : 'gci._current = ret[-1]',
110109

@@ -129,11 +128,13 @@ def %(func)s(*args, **kwargs):
129128
# This function was autogenerated by boilerplate.py. Do not edit as
130129
# changes will be lost
131130
def %(name)s():
132-
'set the default colormap to %(name)s and apply to current image if any. See help(colormaps) for more information'
131+
'''
132+
set the default colormap to %(name)s and apply to current image if any.
133+
See help(colormaps) for more information
134+
'''
133135
rc('image', cmap='%(name)s')
134136
im = gci()
135137
136-
137138
if im is not None:
138139
im.set_cmap(cm.%(name)s)
139140
draw_if_interactive()

examples/gdtest.py

Lines changed: 0 additions & 34 deletions
This file was deleted.

examples/rc_traits.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -128,8 +128,8 @@ class PatchRC(traits.HasTraits):
128128
antialiased = flexible_true_trait
129129

130130
timezones = 'UTC', 'US/Central', 'ES/Eastern' # fixme: and many more
131-
backends = ('GTKAgg', 'Cairo', 'FltkAgg', 'GD', 'GDK', 'GTK', 'Agg',
132-
'GTKCairo', 'Paint', 'PS', 'SVG', 'Template', 'TkAgg',
131+
backends = ('GTKAgg', 'Cairo', 'FltkAgg', 'GDK', 'GTK', 'Agg',
132+
'GTKCairo', 'PS', 'SVG', 'Template', 'TkAgg',
133133
'WX')
134134

135135
class RC(traits.HasTraits):

lib/matplotlib/__init__.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -530,16 +530,16 @@ def matplotlib_fname():
530530

531531

532532
class RcParams(dict):
533-
533+
534534
"""A dictionary object including validation
535-
535+
536536
validating functions are defined and associated with rc parameters in
537537
rcsetup.py
538538
"""
539-
539+
540540
validate = dict([ (key, converter) for key, (default, converter) in \
541541
defaultParams.iteritems() ])
542-
542+
543543
def __setitem__(self, key, val):
544544
try:
545545
if key in _deprecated_map.keys():
@@ -620,7 +620,7 @@ def rc_params(fail_on_error=False):
620620
ret['datapath'] = get_data_path()
621621

622622
verbose.report('loaded rc file %s'%fname)
623-
623+
624624
return ret
625625

626626

lib/matplotlib/config/mplconfig.py

Lines changed: 35 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ class MPLConfig(TConfig):
3939
key = val optional comment
4040
4141
val should be valid python syntax, just as you would use when setting
42-
properties using rcParams. This should become more obvious by inspecting
42+
properties using rcParams. This should become more obvious by inspecting
4343
the default values listed herein.
4444
4545
Colors: for the color values below, you can either use
@@ -50,7 +50,7 @@ class MPLConfig(TConfig):
5050
- a legal html color name, eg red, blue, darkslategray
5151
5252
Interactivity: see http://matplotlib.sourceforge.net/interactive.html.
53-
53+
5454
### CONFIGURATION BEGINS HERE ###
5555
"""
5656

@@ -61,15 +61,15 @@ class MPLConfig(TConfig):
6161
numerix = T.Trait('numpy', 'numpy', 'numeric', 'numarray')
6262
maskedarray = T.false
6363
units = T.false
64-
64+
6565
class backend(TConfig):
6666
"""Valid backends are: 'GTKAgg', 'GTKCairo', 'QtAgg', 'Qt4Agg',
6767
'TkAgg', 'Agg', 'Cairo', 'PS', 'PDF', 'SVG'"""
6868
use = T.Trait('TkAgg', mplT.BackendHandler())
69-
69+
7070
class cairo(TConfig):
7171
format = T.Trait('png', 'png', 'ps', 'pdf', 'svg')
72-
72+
7373
class tk(TConfig):
7474
"""
7575
window_focus : Maintain shell focus for TkAgg
@@ -78,7 +78,7 @@ class tk(TConfig):
7878

7979
window_focus = T.false
8080
pythoninspect = T.false
81-
81+
8282
class ps(TConfig):
8383
papersize = T.Trait('letter', 'auto', 'letter', 'legal', 'ledger',
8484
'A0', 'A1', 'A2', 'A3', 'A4', 'A5', 'A6', 'A7',
@@ -87,22 +87,22 @@ class ps(TConfig):
8787
'B8', 'B9', 'B10')
8888
useafm = T.false
8989
fonttype = T.Trait(3, 42)
90-
90+
9191
class distiller(TConfig):
9292
use = T.Trait(None, None, 'ghostscript', 'xpdf', False)
9393
resolution = T.Float(6000)
94-
94+
9595
class pdf(TConfig):
9696
compression = T.Range(0, 9, 6)
9797
fonttype = T.Trait(3, 42)
9898
inheritcolor = T.false
9999
use14corefonts = T.false
100-
100+
101101
class svg(TConfig):
102102
image_inline = T.true
103103
image_noscale = T.false
104104
embed_chars = T.true
105-
105+
106106
class lines(TConfig):
107107
linewidth = T.Float(1.0)
108108
linestyle = T.Trait('-','--','-.', ':', 'steps', '', ' ', None)
@@ -122,10 +122,10 @@ class patch(TConfig):
122122
linewidth = T.Float(1.0)
123123
facecolor = T.Trait('blue', mplT.ColorHandler())
124124
edgecolor = T.Trait('black', mplT.ColorHandler())
125-
antialiased = T.true
125+
antialiased = T.true
126126

127127
class font(TConfig):
128-
family = T.Trait('sans-serif', 'sans-serif', 'serif', 'cursive',
128+
family = T.Trait('sans-serif', 'sans-serif', 'serif', 'cursive',
129129
'fantasy', 'monospace')
130130
style = T.Trait('normal', 'normal', 'italic', 'oblique')
131131
variant = T.Trait('normal', 'normal', 'small-caps')
@@ -136,29 +136,29 @@ class font(TConfig):
136136
'expanded', 'extra-expanded', 'ultra-expanded',
137137
'wider', 'narrower')
138138
size = T.Float(12.0)
139-
serif = T.ListStr(["Bitstream Vera Serif", "New Century Schoolbook",
140-
"Century Schoolbook L", "Utopia", "ITC Bookman", "Bookman",
141-
"Nimbus Roman No9 L", "Times New Roman", "Times", "Palatino",
139+
serif = T.ListStr(["Bitstream Vera Serif", "New Century Schoolbook",
140+
"Century Schoolbook L", "Utopia", "ITC Bookman", "Bookman",
141+
"Nimbus Roman No9 L", "Times New Roman", "Times", "Palatino",
142142
"Charter", "serif"])
143-
sans_serif = T.ListStr(["Bitstream Vera Sans", "Lucida Grande", "Verdana",
144-
"Geneva", "Lucid", "Arial", "Helvetica", "Avant Garde",
143+
sans_serif = T.ListStr(["Bitstream Vera Sans", "Lucida Grande", "Verdana",
144+
"Geneva", "Lucid", "Arial", "Helvetica", "Avant Garde",
145145
"sans-serif"])
146-
cursive = T.ListStr(["Apple Chancery", "Textile", "Zapf Chancery", "Sand",
146+
cursive = T.ListStr(["Apple Chancery", "Textile", "Zapf Chancery", "Sand",
147147
"cursive"])
148-
fantasy = T.ListStr(["Comic Sans MS", "Chicago", "Charcoal", "Impact", "Western",
148+
fantasy = T.ListStr(["Comic Sans MS", "Chicago", "Charcoal", "Impact", "Western",
149149
"fantasy"])
150150
monospace = T.ListStr(["Bitstream Vera Sans Mono", "Andale Mono", "Nimbus Mono L",
151151
"Courier New", "Courier", "Fixed", "Terminal", "monospace"])
152152

153153
class text(TConfig):
154154
color = T.Trait('black',mplT.ColorHandler())
155155
usetex = T.false
156-
156+
157157
class latex(TConfig):
158158
unicode = T.false
159159
preamble = T.ListStr([])
160160
dvipnghack = T.false
161-
161+
162162
class mathtext(TConfig):
163163
cal = T.Trait('cursive' , mplT.FontconfigPatternHandler())
164164
rm = T.Trait('serif' , mplT.FontconfigPatternHandler())
@@ -182,16 +182,16 @@ class axes(TConfig):
182182
'large', 'x-large', 'xx-large', T.Float)
183183
labelcolor = T.Trait('black', mplT.ColorHandler())
184184
axisbelow = T.false
185-
185+
186186
class formatter(TConfig):
187187
limits = T.List(T.Float, [-7, 7], minlen=2, maxlen=2)
188-
188+
189189
class xticks(TConfig):
190190
color = T.Trait('black', mplT.ColorHandler())
191191
labelsize = T.Trait('small', 'xx-small', 'x-small', 'small', 'medium',
192192
'large', 'x-large', 'xx-large', T.Float)
193193
direction = T.Trait('in', 'out')
194-
194+
195195
class major(TConfig):
196196
size = T.Float(4)
197197
pad = T.Float(4)
@@ -205,7 +205,7 @@ class yticks(TConfig):
205205
labelsize = T.Trait('small', 'xx-small', 'x-small', 'small', 'medium',
206206
'large', 'x-large', 'xx-large', T.Float)
207207
direction = T.Trait('in', 'out')
208-
208+
209209
class major(TConfig):
210210
size = T.Float(4)
211211
pad = T.Float(4)
@@ -220,8 +220,8 @@ class grid(TConfig):
220220
linewidth = T.Float(0.5)
221221

222222
class legend(TConfig):
223-
loc = T.Trait('upper right', 'best', 'upper right', 'upper left',
224-
'lower left', 'lower right', 'right', 'center left',
223+
loc = T.Trait('upper right', 'best', 'upper right', 'upper left',
224+
'lower left', 'lower right', 'right', 'center left',
225225
'center right', 'lower center', 'upper center', 'center')
226226
isaxes = T.true
227227
numpoints = T.Int(3)
@@ -264,26 +264,26 @@ class image(TConfig):
264264

265265
class contour(TConfig):
266266
negative_linestyle = T.Trait('dashed', 'dashed', 'solid')
267-
267+
268268
class savefig(TConfig):
269269
dpi = T.Float(100)
270270
facecolor = T.Trait('white', mplT.ColorHandler())
271271
edgecolor = T.Trait('white', mplT.ColorHandler())
272272
orientation = T.Trait('portrait', 'portrait', 'landscape')
273-
273+
274274
class verbose(TConfig):
275275
level = T.Trait('silent', 'silent', 'helpful', 'debug', 'debug-annoying')
276276
fileo = T.Trait('sys.stdout', 'sys.stdout', T.File)
277277

278278

279279
class RcParamsWrapper(dict):
280-
280+
281281
"""A backwards-compatible interface to a traited config object
282282
"""
283-
283+
284284
def __init__(self, tconfig):
285285
self.tconfig = tconfig
286-
286+
287287
self.tconfig_map = {
288288
'backend' : (self.tconfig.backend, 'use'),
289289
'numerix' : (self.tconfig, 'numerix'),
@@ -337,7 +337,7 @@ def __init__(self, tconfig):
337337
'text.latex.unicode' : (self.tconfig.text.latex, 'unicode'),
338338
'text.latex.preamble' : (self.tconfig.text.latex, 'preamble'),
339339
'text.dvipnghack' : (self.tconfig.text.latex, 'dvipnghack'),
340-
340+
341341
'mathtext.cal' : (self.tconfig.mathtext, 'cal'),
342342
'mathtext.rm' : (self.tconfig.mathtext, 'rm'),
343343
'mathtext.tt' : (self.tconfig.mathtext, 'tt'),
@@ -455,7 +455,7 @@ def __getitem__(self, key):
455455

456456
def keys(self):
457457
return self.tconfig_map.keys()
458-
458+
459459
def has_key(self, val):
460460
return self.tconfig_map.has_key(val)
461461

@@ -466,7 +466,7 @@ def update(self, arg, **kwargs):
466466
except AttributeError:
467467
for key, val in arg:
468468
self[key] = val
469-
469+
470470
for key in kwargs:
471471
self[key] = kwargs[key]
472472

0 commit comments

Comments
 (0)