8000 Merge pull request #7500 from dstansby/hexbin-edgecolors · matplotlib/matplotlib@adfeab7 · GitHub
[go: up one dir, main page]

Skip to content

Commit adfeab7

Browse files
authored
Merge pull request #7500 from dstansby/hexbin-edgecolors
Set hexbin default linecolor to 'face'
2 parents 1512bee + f97879d commit adfeab7

File tree

3 files changed

+20
-7
lines changed

3 files changed

+20
-7
lines changed

doc/users/dflt_style_changes.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -560,6 +560,13 @@ or by setting::
560560

561561
in your :file:`matplotlibrc` file.
562562

563+
``hexbin``
564+
----------
565+
566+
The default value of the ``linecolor`` kwarg for `~matplotlib.Axes.hexbin` has
567+
changed from ``'none'`` to ``'face'``. If 'none' is now supplied, no line edges
568+
are drawn around the hexagons.
569+
563570
``bar`` and ``barh``
564571
====================
565572

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
Hexbin default line color
2+
-------------------------
3+
4+
The default ``linecolor`` kwarg for :func:`hexbin` is now ``'face'``, and
5+
supplying ``'none'`` now prevents lines from being drawn around the hexagons.

lib/matplotlib/axes/_axes.py

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4069,7 +4069,7 @@ def scatter(self, x, y, s=None, c=None, marker=None, cmap=None, norm=None,
40694069
def hexbin(self, x, y, C=None, gridsize=100, bins=None,
40704070
xscale='linear', yscale='linear', extent=None,
40714071
cmap=None, norm=None, vmin=None, vmax=None,
4072-
alpha=None, linewidths=None, edgecolors='none',
4072+
alpha=None, linewidths=None, edgecolors='face',
40734073
reduce_C_function=np.mean, mincnt=None, marginals=False,
40744074
**kwargs):
40754075
"""
@@ -4163,10 +4163,13 @@ def hexbin(self, x, y, C=None, gridsize=100, bins=None,
41634163
linewidths : scalar, optional, default is *None*
41644164
If *None*, defaults to 1.0.
41654165
4166-
edgecolors : {'none'} or mpl color, optional, default is 'none'
4167-
If 'none', draws the edges in the same color as the fill color.
4168-
This is the default, as it avoids unsightly unpainted pixels
4169-
between the hexagons.
4166+
edgecolors : {'face', 'none', *None*} or mpl color, optional, default\
4167+
is 'face'
4168+
4169+
If 'face', draws the edges in the same color as the fill color.
4170+
4171+
If 'none', no edge is drawn; this can sometimes lead to unsightly
4172+
unpainted pixels between the hexagons.
41704173
41714174
If *None*, draws outlines in the default color.
41724175
@@ -4353,8 +4356,6 @@ def hexbin(self, x, y, C=None, gridsize=100, bins=None,
43534356
polygon[:, 0] = sx * np.array([0.5, 0.5, 0.0, -0.5, -0.5, 0.0])
43544357
polygon[:, 1] = sy * np.array([-0.5, 0.5, 1.0, 0.5, -0.5, -1.0]) / 3.0
43554358

4356-
if edgecolors == 'none':
4357-
edgecolors = 'face'
43584359
if linewidths is None:
43594360
linewidths = [1.0]
43604361

0 commit comments

Comments
 (0)
0