Skip to content

Commit dff8c8f

Browse files
committed
Removed last vestiges of old pcolor, scatter, quiver versions.
svn path=/trunk/matplotlib/; revision=3630
1 parent 20c7447 commit dff8c8f

File tree

4 files changed

+2
-272
lines changed

4 files changed

+2
-272
lines changed

CHANGELOG

+1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
2007-07-29 Changed default pcolor shading to flat; added aliases
22
to make collection kwargs agree with setter names, so
33
updating works; related minor cleanups.
4+
Removed quiver_classic, scatter_classic, pcolor_classic. - EF
45

56
2007-07-26 Major rewrite of mathtext.py, using the TeX box layout model.
67

boilerplate.py

-1
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,6 @@ def %(func)s(*args, **kwargs):
8282
'stem',
8383
'vlines',
8484
'quiver',
85-
'quiver2',
8685
'quiverkey',
8786
'xcorr',
8887
)

lib/matplotlib/axes.py

+1-179
Original file line numberDiff line numberDiff line change
@@ -4051,34 +4051,6 @@ def scatter(self, x, y, s=20, c='b', marker='o', cmap=None, norm=None,
40514051

40524052
scatter.__doc__ = cbook.dedent(scatter.__doc__) % martist.kwdocd
40534053

4054-
def scatter_classic(self, x, y, s=None, c='b'):
4055-
"""
4056-
scatter_classic is no longer available; please use scatter.
4057-
To help in porting, for comparison to the scatter docstring,
4058-
here is the scatter_classic docstring:
4059-
4060-
SCATTER_CLASSIC(x, y, s=None, c='b')
4061-
4062-
Make a scatter plot of x versus y. s is a size (in data coords) and
4063-
can be either a scalar or an array of the same length as x or y. c is
4064-
a color and can be a single color format string or an length(x) array
4065-
of intensities which will be mapped by the colormap jet.
4066-
4067-
If size is None a default size will be used
4068-
"""
4069-
raise NotImplementedError('scatter_classic has been removed;\n'
4070-
+ 'please use scatter instead')
4071-
4072-
def pcolor_classic(self, *args):
4073-
"""
4074-
pcolor_classic is no longer available; please use pcolor,
4075-
which is a drop-in replacement.
4076-
"""
4077-
raise NotImplementedError('pcolor_classic has been removed;\n'
4078-
+ 'please use pcolor instead')
4079-
4080-
4081-
40824054
def arrow(self, x, y, dx, dy, **kwargs):
40834055
"""
40844056
Draws arrow on specified axis from (x,y) to (x+dx,y+dy).
@@ -4097,164 +4069,14 @@ def quiverkey(self, *args, **kw):
40974069
return qk
40984070
quiverkey.__doc__ = mquiver.QuiverKey.quiverkey_doc
40994071

4100-
def quiver2(self, *args, **kw):
4072+
def quiver(self, *args, **kw):
41014073
q = mquiver.Quiver(self, *args, **kw)
41024074
self.add_collection(q)
41034075
self.update_datalim_numerix(q.X, q.Y)
41044076
self.autoscale_view()
41054077
return q
4106-
quiver2.__doc__ = mquiver.Quiver.quiver_doc
4107-
4108-
def quiver(self, *args, **kw):
4109-
if (len(args) == 3 or len(args) == 5) and not iterable(args[-1]):
4110-
return self.quiver_classic(*args, **kw)
4111-
c = kw.get('color', None)
4112-
if c is not None:
4113-
if not mcolors.is_color_like(c):
4114-
assert npy.shape(npy.asarray(c)) == npy.shape(npy.asarray(args[-1]))
4115-
return self.quiver_classic(*args, **kw)
4116-
return self.quiver2(*args, **kw)
41174078
quiver.__doc__ = mquiver.Quiver.quiver_doc
41184079

4119-
def quiver_classic(self, U, V, *args, **kwargs ):
4120-
"""
4121-
QUIVER( X, Y, U, V )
4122-
QUIVER( U, V )
4123-
QUIVER( X, Y, U, V, S)
4124-
QUIVER( U, V, S )
4125-
QUIVER( ..., color=None, width=1.0, cmap=None, norm=None )
4126-
4127-
Make a vector plot (U, V) with arrows on a grid (X, Y)
4128-
4129-
If X and Y are not specified, U and V must be 2D arrays.
4130-
Equally spaced X and Y grids are then generated using the
4131-
meshgrid command.
4132-
4133-
color can be a color value or an array of colors, so that the
4134-
arrows can be colored according to another dataset. If cmap
4135-
is specified and color is 'length', the colormap is used to
4136-
give a color according to the vector's length.
4137-
4138-
If color is a scalar field, the colormap is used to map the
4139-
scalar to a color If a colormap is specified and color is an
4140-
array of color triplets, then the colormap is ignored
4141-
4142-
width is a scalar that controls the width of the arrows
4143-
4144-
if S is specified it is used to scale the vectors. Use S=0 to
4145-
disable automatic scaling. If S!=0, vectors are scaled to fit
4146-
within the grid and then are multiplied by S.
4147-
4148-
4149-
"""
4150-
msg = '''This version of quiver is obsolete and will be
4151-
phased out; please use the new quiver.
4152-
'''
4153-
warnings.warn(msg, DeprecationWarning)
4154-
if not self._hold: self.cla()
4155-
do_scale = True
4156-
S = 1.0
4157-
if len(args)==0:
4158-
# ( U, V )
4159-
U = npy.asarray(U)
4160-
V = npy.asarray(V)
4161-
X,Y = mlab.meshgrid( npy.arange(U.shape[1]), npy.arange(U.shape[0]) )
4162-
elif len(args)==1:
4163-
# ( U, V, S )
4164-
U = npy.asarray(U)
4165-
V = npy.asarray(V)
4166-
X,Y = mlab.meshgrid( npy.arange(U.shape[1]), npy.arange(U.shape[0]) )
4167-
S = float(args[0])
4168-
do_scale = ( S != 0.0 )
4169-
elif len(args)==2:
4170-
# ( X, Y, U, V )
4171-
X = npy.asarray(U)
4172-
Y = npy.asarray(V)
4173-
U = npy.asarray(args[0])
4174-
V = npy.asarray(args[1])
4175-
elif len(args)==3:
4176-
# ( X, Y, U, V )
4177-
X = npy.asarray(U)
4178-
Y = npy.asarray(V)
4179-
U = npy.asarray(args[0])
4180-
V = npy.asarray(args[1])
4181-
S = float(args[2])
4182-
do_scale = ( S != 0.0 )
4183-
4184-
assert U.shape == V.shape
4185-
assert X.shape == Y.shape
4186-
assert U.shape == X.shape
4187-
4188-
U = U.ravel()
4189-
V = V.ravel()
4190-
X = X.ravel()
4191-
Y = Y.ravel()
4192-
4193-
arrows = []
4194-
N = npy.sqrt( U**2+V**2 )
4195-
if do_scale:
4196-
Nmax = maximum.reduce(N) or 1 # account for div by zero
4197-
U = U*(S/Nmax)
4198-
V = V*(S/Nmax)
4199-
N = N*Nmax
4200-
4201-
alpha = kwargs.pop('alpha', 1.0)
4202-
width = kwargs.pop('width', .5)
4203-
norm = kwargs.pop('norm', None)
4204-
cmap = kwargs.pop('cmap', None)
4205-
vmin = kwargs.pop('vmin', None)
4206-
vmax = kwargs.pop('vmax', None)
4207-
color = kwargs.pop('color', None)
4208-
shading = kwargs.pop('shading', 'faceted')
4209-
4210-
if len(kwargs):
4211-
raise TypeError(
4212-
"quiver() got an unexpected keyword argument '%s'"%kwargs.keys()[0])
4213-
4214-
C = None
4215-
if color == 'length' or color is True:
4216-
if color is True:
4217-
warnings.warn('''Use "color='length'",
4218-
not "color=True"''', DeprecationWarning)
4219-
C = N
4220-
elif color is None:
4221-
color = (0,0,0,1)
4222-
else:
4223-
clr = npy.asarray(color).ravel()
4224-
if clr.shape == U.shape:
4225-
C = clr
4226-
4227-
I = U.shape[0]
4228-
arrows = [mpatches.FancyArrow(X[i],Y[i],U[i],V[i],0.1*S ).get_verts()
4229-
for i in xrange(I)]
4230-
4231-
collection = mcoll.PolyCollection(
4232-
arrows,
4233-
edgecolors = 'None',
4234-
antialiaseds = (1,),
4235-
linewidths = (width,),
4236-
)
4237-
if C is not None:
4238-
collection.set_array( C.ravel() )
4239-
collection.set_cmap(cmap)
4240-
collection.set_norm(norm)
4241-
if norm is not None:
4242-
collection.set_clim( vmin, vmax )
4243-
else:
4244-
collection.set_facecolor(color)
4245-
self.add_collection( collection )
4246-
4247-
lims = npy.asarray(arrows)
4248-
_max = maximum.reduce( maximum.reduce( lims ))
4249-
_min = minimum.reduce( minimum.reduce( lims ))
4250-
self.update_datalim( [ tuple(_min), tuple(_max) ] )
4251-
self.autoscale_view()
4252-
return collection
4253-
4254-
4255-
4256-
4257-
42584080
def fill(self, *args, **kwargs):
42594081
"""
42604082
FILL(*args, **kwargs)

lib/matplotlib/pylab.py

-92
Original file line numberDiff line numberDiff line change
@@ -335,64 +335,6 @@ def colorbar(mappable = None, cax=None,**kw):
335335
colorbar.__doc__ = colorbar_doc
336336

337337

338-
def colorbar_classic(mappable = None,
339-
cax=None,
340-
orientation='vertical',
341-
tickfmt='%1.1f',
342-
cspacing='proportional',
343-
clabels=None,
344-
drawedges=False,
345-
edgewidth=0.5,
346-
edgecolor='k'):
347-
"""
348-
Create a colorbar for mappable; if mappable is None,
349-
use current image.
350-
351-
tickfmt is a format string to format the colorbar ticks
352-
353-
cax is a colorbar axes instance in which the colorbar will be
354-
placed. If None, as default axesd will be created resizing the
355-
current aqxes to make room for it. If not None, the supplied axes
356-
will be used and the other axes positions will be unchanged.
357-
358-
orientation is the colorbar orientation: one of 'vertical' | 'horizontal'
359-
360-
cspacing controls how colors are distributed on the colorbar.
361-
if cspacing == 'linear', each color occupies an equal area
362-
on the colorbar, regardless of the contour spacing.
363-
if cspacing == 'proportional' (Default), the area each color
364-
occupies on the the colorbar is proportional to the contour interval.
365-
Only relevant for a Contour image.
366-
367-
clabels can be a sequence containing the
368-
contour levels to be labelled on the colorbar, or None (Default).
369-
If clabels is None, labels for all contour intervals are
370-
displayed. Only relevant for a Contour image.
371-
372-
if drawedges == True, lines are drawn at the edges between
373-
each color on the colorbar. Default False.
374-
375-
edgecolor is the line color delimiting the edges of the colors
376-
on the colorbar (if drawedges == True). Default black ('k')
377-
378-
edgewidth is the width of the lines delimiting the edges of
379-
the colors on the colorbar (if drawedges == True). Default 0.5
380-
381-
return value is the colorbar axes instance
382-
"""
383-
if mappable is None:
384-
mappable = gci()
385-
ret = gcf().colorbar_classic(mappable, cax = cax,
386-
orientation = orientation,
387-
tickfmt = tickfmt,
388-
cspacing=cspacing,
389-
clabels=clabels,
390-
drawedges=drawedges,
391-
edgewidth=edgewidth,
392-
edgecolor=edgecolor)
393-
draw_if_interactive()
394-
return ret
395-
396338
def colors():
397339
"""
398340
This is a do nothing function to provide you with help on how
@@ -1606,19 +1548,6 @@ def getname_val(identifier):
16061548

16071549
draw_if_interactive()
16081550

1609-
### Deprecated functions:
1610-
def scatter_classic(*args, **kwargs):
1611-
return gca().scatter_classic(*args, **kwargs)
1612-
if Axes.scatter_classic.__doc__ is not None:
1613-
scatter_classic.__doc__ = dedent(Axes.scatter_classic.__doc__)
1614-
1615-
def pcolor_classic(*args, **kwargs):
1616-
return gca().pcolor_classic(*args, **kwargs)
1617-
if Axes.pcolor_classic.__doc__ is not None:
1618-
pcolor_classic.__doc__ = dedent(Axes.pcolor_classic.__doc__)
1619-
1620-
1621-
16221551
### Do not edit below this point
16231552
# This function was autogenerated by boilerplate.py. Do not edit as
16241553
# changes will be lost
@@ -2355,27 +2284,6 @@ def quiver(*args, **kwargs):
23552284
quiver.__doc__ = dedent(Axes.quiver.__doc__) + """
23562285
Addition kwargs: hold = [True|False] overrides default hold state"""
23572286

2358-
# This function was autogenerated by boilerplate.py. Do not edit as
2359-
# changes will be lost
2360-
def quiver2(*args, **kwargs):
2361-
# allow callers to override the hold state by passing hold=True|False
2362-
b = ishold()
2363-
h = popd(kwargs, 'hold', None)
2364-
if h is not None:
2365-
hold(h)
2366-
try:
2367-
ret = gca().quiver2(*args, **kwargs)
2368-
draw_if_interactive()
2369-
except:
2370-
hold(b)
2371-
raise
2372-
gci._current = ret
2373-
hold(b)
2374-
return ret
2375-
if Axes.quiver2.__doc__ is not None:
2376-
quiver2.__doc__ = dedent(Axes.quiver2.__doc__) + """
2377-
Addition kwargs: hold = [True|False] overrides default hold state"""
2378-
23792287
# This function was autogenerated by boilerplate.py. Do not edit as
23802288
# changes will be lost
23812289
def quiverkey(*args, **kwargs):

0 commit comments

Comments
 (0)