Created
January 13, 2017 16:55
-
-
Save syrte/0aef480671a760222207cf8221bee1de to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def plot_binquantile(x, y, bins=10, weights=None, nmin=3, nanas=None, | |
| kwargs_sig2=None, **kwargs): | |
| from .stats import binquantile, mid | |
| from .helper import errorbar2 | |
| nsig = [0, -1, 1, -2, 2] | |
| quantile = binquantile(x, y, bins=bins, weights=weights, | |
| nsig=nsig, nmin=nmin, nanas=nanas, | |
| shape='stats') | |
| stats, edges, count = quantile | |
| xmid = mid(edges[0]) | |
| if isinstance(kwargs_sig2, dict): | |
| kwargs_sig2.setdefault('ecolor', 'c') | |
| kwargs_sig2.setdefault('fmt', 'none') | |
| errorbar2(xmid, stats[0], yerr=stats[3:5], **kwargs_sig2) | |
| kwargs.setdefault('color', 'k') | |
| kwargs.setdefault('fmt', 's') | |
| errorbar2(xmid, stats[0], yerr=stats[1:3], **kwargs) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment