Skip to content

Conversation

phobson
Copy link
Member

@phobson phobson commented Mar 26, 2013

Hey folks,

This PR takes care of a case where an oddly-distributed and small dataset causes some mayhem in the boxplots. An example that reproduces this error in the current master is below:

import numpy as np
import matplotlib.pyplot as plt
x = np.array([3, 9000, 150, 88, 350, 200000, 1400, 960], dtype=np.float64)
fig, ax1 = plt.subplots()
ax1.boxplot(x)
ax1.set_yscale('log')
ax1.yaxis.grid(False, which='minor')
ax1.xaxis.grid(False)
plt.show()

...Which produces:
bad-whisker

The changes to axes.boxplot where very minor and I've include an new test with baseline images as well. Thanks for the effort, y'all.

@dmcdougall
Copy link
Member

Great effort @phobson, and a test too! You make my life easy :) Would you be able to add remove_text=True as a kwarg to the test decorator? This helps alleviate some of the text issues we have with testing with text on multiple platforms. You will need to rerun the test and update the baseline image with this new change incorporated.

As an aside, I have no idea if the new output is 'correct', so I assume you are happy that it is.

@phobson
Copy link
Member Author

phobson commented Mar 26, 2013

@dmcdougall done. I am happy with the output as is, but definitely welcome input from other devs and users. I posted a message to the statsmodels list and pointed them here hoping that they share some informed opinions.

@phobson
Copy link
Member Author

phobson commented May 13, 2013

Any chance we can push this through for v1.3?

@phobson phobson closed this May 13, 2013
@phobson phobson reopened this May 13, 2013
@mdboom
Copy link
Member

mdboom commented May 13, 2013

@phobson: I've milestoned this as 1.3.x. This looks pretty complete. Maybe just a short whats_new entry?

@pelson
Copy link
Member

pelson commented May 14, 2013

Merged with c7278d2 (with a couple of modifications). Nice work @phobson!

@pelson pelson closed this May 14, 2013
@phobson phobson deleted the fix-boxplot-upsidedown-whisker branch January 27, 2014 17:04
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.

4 participants