Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Boxplot zorder kwarg #7178

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 4 commits into from
Sep 29, 2016
Merged

Boxplot zorder kwarg #7178

merged 4 commits into from
Sep 29, 2016

Conversation

bcongdon
Copy link
Contributor

boxplot now accepts the zorder kwarg to set the zorder of the drawn boxplot in the plotting function.

Addresses #7171

@@ -3555,7 +3561,6 @@ def bxp(self, bxpstats, positions=None, widths=None, vert=True,
# empty list of xticklabels
datalabels = []

zorder = mlines.Line2D.zorder
Copy link
Member

Choose a reason for hiding this comment

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

I have a weak preference for this continuing to track mlines.Line2D.zorder by default, but could very easily be talked into change it.

@tacaswell tacaswell added this to the 2.0.1 (next bug fix release) milestone Sep 26, 2016
@tacaswell
Copy link
Member

It is low-risk and an oversight in the API so I think it is reasonable to backport to 2.x. Open to anyone talking me out of this position.

@@ -3095,7 +3095,7 @@ def boxplot(self, x, notch=None, sym=None, vert=None, whis=None,
showbox=None, showfliers=None, boxprops=None,
labels=None, flierprops=None, medianprops=None,
meanprops=None, capprops=None, whiskerprops=None,
manage_xticks=True, autorange=False):
manage_xticks=True, autorange=False, zorder=2):
Copy link
Member

Choose a reason for hiding this comment

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

It is better to have zorder=None here so anyone who want to use default value can pass None explicitly.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good idea. I debated doing it this way, but streamplot had a default zorder of 2 IIRC, so I went with that convention.

I'll make the change in a bit.

@WeatherGod
Copy link
Member

If streamplot() still has a hardcoded property kwarg, then that is a bug
and needs to be fixed.

On Mon, Sep 26, 2016 at 2:02 PM, Ben Congdon [email protected]
wrote:

@bcongdon commented on this pull request.

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

@@ -3095,7 +3095,7 @@ def boxplot(self, x, notch=None, sym=None, vert=None, whis=None,
showbox=None, showfliers=None, boxprops=None,
labels=None, flierprops=None, medianprops=None,
meanprops=None, capprops=None, whiskerprops=None,

  •            manage_xticks=True, autorange=False):
    
  •            manage_xticks=True, autorange=False, zorder=2):
    

Good idea. I debated doing it this way, but streamplot had a default
zorder of 2 IIRC, so I went with that convention.

I'll make the change in a bit.


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
#7178, or mute the thread
https://github.com/notifications/unsubscribe-auth/AARy-NFh9wQq9hQ7EJbEkZs_nq_67wR8ks5quAjAgaJpZM4KGpZz
.

@bcongdon bcongdon force-pushed the boxplot-zorder branch 2 times, most recently from 9fe3a36 to 0723cd5 Compare September 26, 2016 20:39
@tacaswell
Copy link
Member

@WeatherGod bug seems a bit strong, just one more piece of technical debt 😉

@bcongdon
Copy link
Contributor Author

It looks like streamplot does still have that hard-coded value. Should I open a separate PR for that issue, or include it in this one?

@efiring
Copy link
Member

efiring commented Sep 27, 2016

On 2016/09/26 1:55 PM, Ben Congdon wrote:

It looks like |streamplot| does still have that hard-coded value. Should
I open a separate PR for that issue, or include it in this one?

A separate PR would be good.

return artists

def bxp(self, bxpstats, positions=None, widths=None, vert=True,
patch_artist=False, shownotches=False, showmeans=False,
showcaps=True, showbox=True, showfliers=True,
boxprops=None, whiskerprops=None, flierprops=None,
medianprops=None, capprops=None, meanprops=None,
meanline=False, manage_xticks=True):
meanline=False, manage_xticks=True, zorder=2):
Copy link
Member

Choose a reason for hiding this comment

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

Can you change this to None too?

@@ -3382,6 +3385,10 @@ def _update_dict(dictionary, rc_name, properties):
if ci[1] is not None:
stats['cihi'] = ci[1]

# Use default zorder if none specified
if zorder is None:
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 be moved to bxp and just let the None pass through this function.

@bcongdon
Copy link
Contributor Author

I made the requested change. Any insight as to why the tests are failing?

@tacaswell
Copy link
Member

the travis test was flaky, that test is known-fail on windows that we have not dealt with yet.

@tacaswell tacaswell changed the title Boxplot zorder kwarg [MRG+1] Boxplot zorder kwarg Sep 28, 2016
@NelleV NelleV merged commit f8d05a4 into matplotlib:master Sep 29, 2016
@NelleV
Copy link
Member

NelleV commented Sep 29, 2016

Thanks @bcongdon !

@QuLogic QuLogic changed the title [MRG+1] Boxplot zorder kwarg Boxplot zorder kwarg Oct 15, 2016
QuLogic pushed a commit to QuLogic/matplotlib that referenced this pull request Oct 16, 2016
@QuLogic
Copy link
Member

QuLogic commented Oct 16, 2016

Backported to v2.x via e801685.

@QuLogic QuLogic removed this from the 2.0.1 (next bug fix release) milestone Dec 7, 2016
@QuLogic QuLogic modified the milestones: 2.0 (style change major release), 2.0.1 (next bug fix release) Dec 7, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants