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

Probability axes scales #4799

Closed
phobson opened this issue Jul 27, 2015 · 9 comments
Closed

Probability axes scales #4799

phobson opened this issue Jul 27, 2015 · 9 comments

Comments

@phobson
Copy link
Member

phobson commented Jul 27, 2015

I've got a fairly general and battle-tested probability scale implemented here:
https://github.com/Geosyntec/wqio/blob/master/wqio/utils/probscale.py

I think it'd be a generally useful addition to the matplotlib ecosystem. I say ecosystem because it depends on scipy and matplotlib has a policy of not depending on scipy.

I see a few possible paths:

  1. build an embarrassingly small mpltoolkit, publicize it in the official MPL docs
  2. include it in matplotlib, wrap try/expcept ImportError around it, and declare scipy an "optional dependency" from now on (unlikely)
  3. see if seaborn/ggplot want it.

Option 1

Pro: we release it whenever, libraries supporting old versions of MPL can use it right away
Con: it seems like a lot of overhead for something so small.

Option 2

Pro: Once it's in, it's in and people have it
Con: I don't want to open the floodgates of optional dependencies.

Option 3

Pro: those libraries are pretty agile and will be able to adapt/tweak to suit their needs
Con: I think probability scales are generally useful and shouldn't have to be re-implemented in every mpl-based module that might want them (especially in libs like stats-models).

Any thoughts?

Attn: @tacaswell @mwaskom @glamp

statplot

@mwaskom
Copy link

mwaskom commented Jul 27, 2015

The scipy dependency is just needed to get the normal ppf and cdf right? (I haven't looked closely at the code). You could probably just write those out in numpy and then scipy wouldn't be needed.

@phobson
Copy link
Member Author

phobson commented Jul 27, 2015

@mwaskom The current implementation supports any fully spec'd continuous distribution in scipy.stats.distributions. Reimplementing cdf and ppf means we'd need to limit that to just norm (or whatever else could be considered low-hanging fruit).

@mwaskom
Copy link

mwaskom commented Jul 27, 2015

Maybe I'm missing something, but to use a non-default distribution, the user needs to have scipy installed (or really any library that offers RV objects with a certain interface), but matplotlib itself won't depend on scipy. Right?

@phobson
Copy link
Member Author

phobson commented Jul 27, 2015

That's a fair point -- we'd only need to reimplement the default case, if the use wants to pass an API-compliant custom distribution, from scipy or not, that's on them.

@has2k1
Copy link
Contributor

has2k1 commented Aug 2, 2015

@phobson, to have a python ggplot that is on par with its R counterpart I got into a rewrite and I did probability transformations in similar fashion, see.

@phobson
Copy link
Member Author

phobson commented Nov 20, 2015

@tacaswell I've got a sans-scipy probability scale working. Interested or should I just close this?

@phobson phobson closed this as completed Nov 20, 2015
@phobson phobson reopened this Nov 20, 2015
@tacaswell
Copy link
Member

Interested, but maybe it should live in it's own repo in the matplotlib organization. That would (annoyingly) mean you could use scipy.

@phobson
Copy link
Member Author

phobson commented Nov 20, 2015

OK -- I'll throw it up in its own repo under my name for now. If Matplotlib The Organization ™️ wants to own it, y'all can have it.

Closing this for now.

(to be clear, what I have doesn't require scipy at all)

@phobson phobson closed this as completed Nov 20, 2015
@phobson
Copy link
Member Author

phobson commented Nov 20, 2015

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

4 participants