Set hexbin default linecolor to 'face' #7500

Merged
merged 3 commits into from Nov 23, 2016

Conversation

Projects
5 participants
Contributor

dstansby commented Nov 22, 2016

Fixes #7185

@dstansby dstansby Set hexbin default linecolor to 'face'
17a3ead
@NelleV

Hi @dstansby
The patch looks good overall, but there are pep8 incompatible changes added. Also, can you document those changes in the default change section
(doc/users/dflt_style_changes.rst) and what's new section (doc/users/whats_new/README.rst).
Thanks

lib/matplotlib/axes/_axes.py
- 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'
@NelleV

NelleV Nov 22, 2016

Contributor

This line is too long for pep8. It should be 79 char or less.

@dstansby

dstansby Nov 23, 2016

Contributor

I'm currently struggling to find a way to split it on to two lines without the 2nd line just becoming part of the paragraph underneath... Any ideas?

@tacaswell

tacaswell Nov 23, 2016

Owner

This is an acceptable place to use \ to break the doc line.

@NelleV

NelleV Nov 23, 2016

Contributor

something like
edgecolors : {"face", "none", None, color}, optional, default: "face" would also have been acceptable.

NelleV changed the title from Set hexbin default linecolor to 'face' to [MRG] Set hexbin default linecolor to 'face' Nov 22, 2016

dstansby added some commits Nov 23, 2016

@dstansby dstansby Make hexbin docstring PEP8 compliant 6f1a944
@dstansby dstansby Document hexbin linecolor kwarg changes
f97879d

tacaswell changed the title from [MRG] Set hexbin default linecolor to 'face' to [MRG+1] Set hexbin default linecolor to 'face' Nov 23, 2016

+
+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.
@tacaswell

tacaswell Nov 23, 2016

Owner

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

Owner

efiring commented Nov 23, 2016

On 2016/11/23 10:34 AM, Thomas A Caswell wrote:

@tacaswell commented on this pull request.


In lib/matplotlib/axes/_axes.py
#7500:

@@ -4163,10 +4163,12 @@ 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'
    

This is an acceptable place to use || to break the doc line.

Or just leave out the "optional"? After all, specifying the default
only makes sense if it is optional.
Alternatively, a reasonable convention would be to say that if the
default is not specified on an optional parameter, the default is the
first entry in the list of possibilities.

Member

QuLogic commented Nov 23, 2016

the default is the first entry in the list of possibilities.

That's how Numpydoc already defines arguments that take a restricted set of inputs.

@NelleV NelleV merged commit adfeab7 into matplotlib:master Nov 23, 2016

0 of 3 checks passed

continuous-integration/appveyor/pr Waiting for AppVeyor build to complete
Details
continuous-integration/travis-ci/pr The Travis CI build is in progress
Details
coverage/coveralls Coverage pending from Coveralls.io
Details
Contributor

NelleV commented Nov 23, 2016

Thanks for the patch @dstansby !

QuLogic changed the title from [MRG+1] Set hexbin default linecolor to 'face' to Set hexbin default linecolor to 'face' Nov 23, 2016

QuLogic removed the needs_revision label Nov 24, 2016

dstansby deleted the dstansby:hexbin-edgecolors branch Nov 24, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment