Skip to content
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

boxplot() and xticklabels #3563

Closed
kaufman opened this issue Sep 25, 2014 · 4 comments
Closed

boxplot() and xticklabels #3563

kaufman opened this issue Sep 25, 2014 · 4 comments
Milestone

Comments

@kaufman
Copy link
Contributor

kaufman commented Sep 25, 2014

There's a bug with the xticklabels using boxplot:

a = [[1,2,3,4],[1,2,3,4],[1,2,3,4]]
clf()
boxplot(a, False, 'k', positions=[1000,1500,2000], widths=50)
xlim(750,2250)
draw()

With master branch, I see the xticklabels show as "1", "2", "3"
with 1.3.x I see "1000", "1500", "2000" as expected.

[tac edited for markup]

@tacaswell tacaswell added this to the v1.4.1 milestone Sep 25, 2014
@cimarronm
Copy link
Contributor

It looks like in cbook.boxplot_stats it is automatically generating labels if none are set based upon incrementing numbers

    if labels is None:
        labels = [str(i) for i in range(1, ncols+1)]
    elif len(labels) != ncols:
        raise ValueError("Dimensions of labels and X must be compatible")

Then in the axes.bxp it uses the position (pos) only if a label isn't set but it is automatically generated above so the position in this case will always be ignored.

            # try to find a new label
            datalabels.append(stats.get('label', pos))

tacaswell added a commit to tacaswell/matplotlib that referenced this issue Sep 25, 2014
If the user does not pass in a label, do not assign one.

Fixes matplotlib#3563
@tacaswell
Copy link
Member

Thanks for tracking that down. I have possible fix up.

@tacaswell
Copy link
Member

@kaufman Can you verify that #3566 fixes the problem?

@kaufman
Copy link
Contributor Author

kaufman commented Sep 27, 2014

Yes, it fixes the problem.

This issue was closed.
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

No branches or pull requests

3 participants