8000 added linewidth and facted to scatter · matplotlib/matplotlib@288ac83 · GitHub
[go: up one dir, main page]

Skip to content

Commit 288ac83

Browse files
committed
added linewidth and facted to scatter
svn path=/trunk/matplotlib/; revision=1354
1 parent 67d39ec commit 288ac83

File tree

2 files changed

+23
-2
lines changed

2 files changed

< 10000 div class="ml-1 text-small text-bold fgColor-success">+23
-2
lines changed

CHANGELOG

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
New entries should be added at the top
22

3+
2005-05-20 Added linewidth and faceted kwarg to scatter to control
4+
edgewidth and color
5+
36
2005-05-18 Added Orsay and JPL qt fixes - JDH
47

58
2005-05-17 Added a psfrag latex backend -- some alignment issues need

lib/matplotlib/axes.py

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2677,7 +2677,9 @@ def set_axis_on(self):
26772677
self.axison = True
26782678

26792679
def scatter(self, x, y, s=20, c='b', marker='o', cmap=None, norm=None,
2680-
vmin=None, vmax=None, alpha=1.0, **kwargs):
2680+
vmin=None, vmax=None, alpha=1.0, linewidths=None,
2681+
faceted=True,
2682+
**kwargs):
26812683
"""
26822684
SCATTER(x, y, s=20, c='b', marker='o', cmap=None, norm=None,
26832685
vmin=None, vmax=None, alpha=1.0)
@@ -2730,7 +2732,18 @@ def scatter(self, x, y, s=20, c='b', marker='o', cmap=None, norm=None,
27302732
instance, your settings for vmin and vmax will be ignored
27312733
27322734
* alpha =1.0 : the alpha value for the patches
2733-
"""
2735+
2736+
* linewidths, if None, defaults to (lines.linewidth,). Note
2737+
that this is a tuple, and if you set the linewidths
2738+
argument you must set it as a sequence of floats, as
2739+
required by PolyCollection -- see
2740+
matplotlib.collections.PolyCollection for details
2741+
2742+
* faceted: if True, will use the default edgecolor for the
2743+
markers. If False, will set the edgecolors to be the same
2744+
as the facecolors
2745+
"""
2746+
27342747
if not self._hold: self.cla()
27352748

27362749
syms = { # a dict from symbol to (numsides, angle)
@@ -2766,10 +2779,15 @@ def scatter(self, x, y, s=20, c='b', marker='o', cmap=None, norm=None,
27662779
else:
27672780
scales = s
27682781

2782+
if faceted: edgecolors = None
2783+
else: edgecolors = 'None'
2784+
27692785
collection = RegularPolyCollection(
27702786
self.figure.dpi,
27712787
numsides, rotation, scales,
27722788
facecolors = colors,
2789+
edgecolors = edgecolors,
2790+
linewidths = linewidths,
27732791
offsets = zip(x,y),
27742792
transOffset = self.transData,
27752793
)

0 commit comments

Comments
 (0)
0