8000 Set hexbin default linecolor to 'face' by dstansby · Pull Request #7500 · matplotlib/matplotlib · GitHub
[go: up one dir, main page]

Skip to content

Set hexbin default linecolor to 'face' #7500

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Nov 23, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions doc/users/dflt_style_changes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -560,6 +560,13 @@ or by setting::

in your :file:`matplotlibrc` file.

``hexbin``
----------

The default value of the ``linecolor`` kwarg for `~matplotlib.Axes.hexbin` has
changed from ``'none'`` to ``'face'``. If 'none' is now supplied, no line edges
are drawn around the hexagons.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should note that the default behavior has not changed (just the meaning of 'none').


``bar`` and ``barh``
====================

Expand Down
5 changes: 5 additions & 0 deletions doc/users/whats_new/default_hexbin_linecolor.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Hexbin default line color
-------------------------

The default ``linecolor`` kwarg for :func:`hexbin` is now ``'face'``, and
supplying ``'none'`` now prevents lines from being drawn around the hexagons.
15 changes: 8 additions & 7 deletions lib/matplotlib/axes/_axes.py
Original file line number Diff line number Diff line change
Expand Up @@ -4069,7 +4069,7 @@ def scatter(self, x, y, s=None, c=None, marker=None, cmap=None, norm=None,
def hexbin(self, x, y, C=None, gridsize=100, bins=None,
xscale='linear', yscale='linear', extent=None,
cmap=None, norm=None, vmin=None, vmax=None,
alpha=None, linewidths=None, edgecolors='none',
alpha=None, linewidths=None, edgecolors='face',
reduce_C_function=np.mean, mincnt=None, marginals=False,
**kwargs):
"""
Expand Down Expand Up @@ -4163,10 +4163,13 @@ def hexbin(self, x, y, C=None, gridsize=100, bins=None,
linewidths : scalar, optional, default is *None*
If *None*, defaults to 1.0.

edgecolors : {'none'} or mpl color, optional, default is 'none'
If 'none', draws the edges in the same color as the fill color.
This is the default, as it avoids unsightly unpainted pixels
between the hexagons.
edgecolors : {'face', 'none', *None*} or mpl color, optional, default\
is 'face'

If 'face', draws the edges in the same color as the fill color.

If 'none', no edge is drawn; this can sometimes lead to unsightly
unpainted pixels between the hexagons.

If *None*, draws outlines in the default color.

Expand Down Expand Up @@ -4353,8 +4356,6 @@ def hexbin(self, x, y, C=None, gridsize=100, bins=None,
polygon[:, 0] = sx * np.array([0.5, 0.5, 0.0, -0.5, -0.5, 0.0])
polygon[:, 1] = sy * np.array([-0.5, 0.5, 1.0, 0.5, -0.5, -1.0]) / 3.0

if edgecolors == 'none':
edgecolors = 'face'
if linewidths is None:
linewidths = [1.0]

Expand Down
0