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

Skip to content

Commit c5b1878

Browse files
committed
slight update to scatter
svn path=/trunk/matplotlib/; revision=3164
1 parent f5c6ad7 commit c5b1878

3 files changed

Lines changed: 14 additions & 18 deletions

File tree

lib/matplotlib/axes.py

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3770,16 +3770,12 @@ def scatter(self, x, y, s=20, c='b', marker='o', cmap=None, norm=None,
37703770

37713771
x, y, s, c = delete_masked_points(x, y, s, c)
37723772

3773-
# Strange kwarg override: kwargs['color'] overrides
3774-
# defaulted kw 'c':
3775-
if kwargs.has_key('color'):
3776-
c = kwargs['color']
3777-
kwargs.pop('color')
3773+
# The inherent ambiguity is resolved in favor of color
3774+
# mapping, not interpretation as rgb or rgba.
37783775
if not is_string_like(c) and iterable(c) and len(c)==len(x):
3779-
colors = None
3776+
colors = None # use cmap, norm after collection is created
37803777
else:
3781-
colors = ( colorConverter.to_rgba(c, alpha), )
3782-
3778+
colors = colorConverter.to_rgba_list(c, alpha)
37833779

37843780
if not iterable(s):
37853781
scales = (s,)

lib/matplotlib/collections.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ def __init__(self,
141141
#self._offsets = offsets
142142
self._offsets = offsets
143143
self._transOffset = transOffset
144-
self._verts = []
144+
self._verts = []
145145

146146
__init__.__doc__ = dedent(__init__.__doc__) % kwdocd
147147

@@ -153,13 +153,13 @@ def pick(self, mouseevent):
153153
if not self.pickable(): return
154154
ind = []
155155
x, y = mouseevent.x, mouseevent.y
156-
for i, thispoly in enumerate(self.get_transformed_patches()):
156+
for i, thispoly in enumerate(self.get_transformed_patches()):
157157
inside = nxutils.pnpoly(x, y, thispoly)
158158
if inside: ind.append(i)
159159
if len(ind):
160160
self.figure.canvas.pick_event(mouseevent, self, ind=ind)
161-
162-
161+
162+
163163
def get_transformed_patches(self):
164164
"""
165165
get a sequence of the polygons in the collection in display (transformed) space
@@ -348,7 +348,7 @@ def draw(self, renderer):
348348
transform = self.get_transform()
349349
transoffset = self.get_transoffset()
350350

351-
351+
352352
transform.freeze()
353353
transoffset.freeze()
354354
self.update_scalarmappable()
@@ -364,14 +364,14 @@ def draw(self, renderer):
364364
transoffset.thaw()
365365
renderer.close_group('polycollection')
366366

367-
367+
368368
def get_verts(self, dataTrans=None):
369369
'''Return vertices in data coordinates.
370370
The calculation is incomplete in general; it is based
371371
on the vertices or the offsets, whichever is using
372372
dataTrans as its transformation, so it does not take
373373
into account the combined effect of segments and offsets.
374-
'''
374+
'''
375375
verts = []
376376
if self._offsets is None:
377377
for seg in self._verts:
@@ -451,7 +451,7 @@ def __init__(self,
451451
__init__.__doc__ = dedent(__init__.__doc__) % kwdocd
452452

453453
def get_transformed_patches(self):
454-
454+
455455
xverts, yverts = zip(*self._verts)
456456
xverts = asarray(xverts)
457457
yverts = asarray(yverts)
@@ -486,7 +486,7 @@ def draw(self, renderer):
486486
self._update_verts()
487487
scales = sqrt(asarray(self._sizes)*self._dpi.get()/72.0)
488488

489-
489+
490490
offsets = self._offsets
491491
if self._offsets is not None:
492492
xs, ys = zip(*offsets)

lib/matplotlib/mpl-data/matplotlibrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
#### CONFIGURATION BEGINS HERE
2727
# the default backend; one of GTK GTKAgg GTKCairo FltkAgg QtAgg TkAgg
2828
# Agg Cairo GD GDK Paint PS PDF SVG Template
29-
backend : TkAgg
29+
backend : WXAgg
3030
numerix : numpy # numpy, Numeric or numarray
3131
units : True
3232
#interactive : False # see http://matplotlib.sourceforge.net/interactive.html

0 commit comments

Comments
 (0)