Default boxplot style rebase #6481

Merged
merged 13 commits into from May 30, 2016

Conversation

Projects
None yet
3 participants
Owner

jenshnielsen commented May 26, 2016

Rebase of #5523 on master hopefully fixing the travis issues.

Owner

jenshnielsen commented May 26, 2016

@phobson I hope you are ok with me making a few changes on top of your PR so we can get it merged before we cut the 2.x beta. I have tried to do a few modifications as possible to restore old default behaviours with matplotlib 1.5.x classic style and fix the tests. Let me know if you can spot any issues.
Otherwise I think this is ready for review. I will need to squash all image changes together before merging but prefer that to wait until this has been reviewed.

Member

phobson commented May 26, 2016

@jenshnielsen absolutely! sorry i was lagging behind

@tacaswell tacaswell commented on the diff May 28, 2016

lib/matplotlib/rcsetup.py
@@ -941,33 +941,37 @@ def validate_animation_writer_path(p):
'boxplot.showfliers': [True, validate_bool],
'boxplot.meanline': [False, validate_bool],
- 'boxplot.flierprops.color': ['C0', validate_color],
@tacaswell

tacaswell May 28, 2016

Owner

All of these changes need to be reflected into the template.

@jenshnielsen

jenshnielsen May 28, 2016

Owner

As far as I can see they already do

Owner

tacaswell commented May 28, 2016

Something is not right here, the output from http://matplotlib.org/examples/pylab_examples/boxplot_demo.html does not seem to respect the color (either on this branch or v1.5.1) but does work on master http://matplotlib.org/devdocs/examples/pylab_examples/boxplot_demo.html

Member

phobson commented May 28, 2016

@tacaswell that is weird. I'm not sure what's going on.

@jenshnielsen I'm not sure why the medians aren't showing up in this example either: https://github.com/matplotlib/matplotlib/pull/6481/files#diff-b5878226d9a3230ab74d34de5a0f994f

phobson added some commits Oct 29, 2015

@phobson @jenshnielsen phobson DEF: updated boxplot styles
Going for the Spinal Tap approach.

Q: How much blacker could the boxplots be?
A: A little, actually. I left some color in the
median line.
d641339
@phobson @jenshnielsen phobson DEF: update default median linecolor for boxplots
It was just "blue". Now it's [0] to pick out the
first color from the existing color cycle,
whatever that may be.
5aa3e44
@phobson @jenshnielsen phobson WIP: use new defaults in Axes.bxp 1f0f91e
@phobson @jenshnielsen phobson DEF: use the --default-- style for bxp/boxplot tests 67a7888
Owner

jenshnielsen commented May 28, 2016

@tacaswell I fixed the color issue (The flier color was set by the marker argument but not the face and edgecolor which was set to default values)

Owner

jenshnielsen commented May 28, 2016

The effect of the color can also be seen in the changes to boxplot_mod_artists_after_plotting.png
The fliers used to have their color set from

bp = ax.boxplot(x, sym="o")
    for key in bp:
        for obj in bp[key]:
            obj.set_color('green')

This is no longer the case because edge and facecolor now takes effect

Owner

jenshnielsen commented May 28, 2016

Running out of time to look more at this at the moment. I will try to get back to it later today.

This will need some test image updated after the fix above.

There seems to be something wrong with test_bxp_custompatchartist
the linestyle is not correctly reflected in the test image (dotted)

tacaswell referenced this pull request May 28, 2016

Closed

WIP: updated defult boxplot styles #5523

1 of 3 tasks complete
Owner

jenshnielsen commented May 30, 2016

@phobson Sorry for being stupid but can you point me exactly to which example is missing the median?
I can only see bxp_patchartist.png which simply has the same patch color as the plotted under the median making it hard to see

Owner

jenshnielsen commented May 30, 2016

So we are talkign about bxp_patchartist.png?
In that test we are plotting a median which has the color C0 on top of a patch with a color C0 so naturally it's not really visible.

We should probably either change the default median color or change the default patch color to use some thing else than patch.facecolor

Member

phobson commented May 30, 2016

Oh yeah. That makes sense. This is tricky. My preference is that if we're filling in the box with a patch artist, the the median should be the same color as the border of the patch artist. 

Sorry if this was unintelligible. I'm on my phone.

On Mon, May 30, 2016 at 7:48 AM -0700, "Jens Hedegaard Nielsen" notifications@github.com wrote:

So we are talkign about bxp_patchartist.png?

In that test we are plotting a median which has the color C0 on top of a patch with a color C0 so naturally it's not really visible.

We should probably either change the default median color or change the default patch color to use some thing else than patch.facecolor


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.

phobson and others added some commits May 10, 2016

@phobson @jenshnielsen phobson PEP8: remove trailing spaces 99b522e
@phobson @jenshnielsen phobson TST: more lenient tolerances for bxp 1eac1a2
@jenshnielsen jenshnielsen Allow boxplot.meanprops.markerfacecolor to be auto 9379ff8
@jenshnielsen jenshnielsen Add old defaults for boxplot to classic style 0b1ff19
@jenshnielsen jenshnielsen make sure template matches rcsetup.py 3ff7d0d
@jenshnielsen jenshnielsen Marker='none' is not valid 29eb3f5
@jenshnielsen jenshnielsen Restore white color of patch in classic mode
This has to be done via internal classic mode because it's using a rc param inherited from patch
5f3be5f
@jenshnielsen jenshnielsen When setting the flier marker override all colors
Setting color alone has no effect as facecolor and edgecolor are still set to the default values
ac43dab
@phobson @jenshnielsen phobson TST: new boxplot/bxp test images
bb0b94b
Owner

jenshnielsen commented May 30, 2016

Thats not really easy to do unfortunately. To do that I think we would need to add a different rc param for the median color when using patch. I changed the defaults mean and median to C1 and C2 which are different from the patch color. I squashed the image changing commits together

@tacaswell tacaswell merged commit 1bf3377 into matplotlib:master May 30, 2016

2 of 3 checks passed

continuous-integration/travis-ci/pr The Travis CI build failed
Details
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
coverage/coveralls Coverage increased (+0.03%) to 69.627%
Details

tacaswell removed the needs_review label May 30, 2016

@tacaswell tacaswell added a commit that referenced this pull request May 31, 2016

@tacaswell tacaswell Merge pull request #6481 from jenshnielsen/default-boxplot-style-rebase
API: Default boxplot style
ff98856
Owner

tacaswell commented May 31, 2016

backported to v2.x as ff98856

Member

phobson commented May 31, 2016

thanks @tacaswell and @jenshnielsen !!

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