Skip to content

Commit 5ebf75c

Browse files
authored
Merge pull request #49 from phobson/cleanup-tutorial-figs
Cleanup tutorial figs
2 parents 18e59b3 + 316dce9 commit 5ebf75c

7 files changed

+75
-99
lines changed

docs/index.rst

+6-6
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,13 @@
77
mpl-probscale: Real probability scales for matplotlib
88
=====================================================
99

10-
.. image:: https://travis-ci.org/phobson/watershed.svg?branch=master
11-
:target: https://travis-ci.org/phobson/watershed
10+
.. image:: https://travis-ci.org/matplotlib/mpl-probscale.svg?branch=master
11+
:target: https://travis-ci.org/matplotlib/mpl-probscale
1212

13-
.. image:: https://coveralls.io/repos/phobson/mpl-probscale/badge.svg?branch=master&service=github
14-
:target: https://coveralls.io/github/phobson/mpl-probscale?branch=master
13+
.. image:: https://coveralls.io/repos/matplotlib/mpl-probscale/badge.svg?branch=master&service=github
14+
:target: https://coveralls.io/github/matplotlib/mpl-probscale?branch=master
1515

16-
https://github.com/phobson/mpl-probscale
16+
https://github.com/matplotlib/mpl-probscale
1717

1818
Installation
1919
------------
@@ -34,7 +34,7 @@ Development builds
3434

3535
Development builds are available through my conda channel:
3636

37-
``conda install mpl-probscale --channel=phobson``
37+
``conda install mpl-probscale --channel=conda-forge``
3838

3939

4040
Quickstart

docs/installation.rst

+4-4
Original file line numberDiff line numberDiff line change
@@ -32,13 +32,13 @@ You can either clone the public repository:
3232

3333
.. code-block:: console
3434
35-
$ git clone git://github.com/phobson/probscale
35+
$ git clone git://github.com/matplotlib/mpl-probscale
3636
3737
Or download the `tarball`_:
3838

3939
.. code-block:: console
4040
41-
$ curl -OL https://github.com/phobson/probscale/tarball/master
41+
$ curl -OL https://github.com/matplotlib/mpl-probscale/tarball/master
4242
4343
Once you have a copy of the source, you can install it with:
4444

@@ -47,5 +47,5 @@ Once you have a copy of the source, you can install it with:
4747
$ pip install .
4848
4949
50-
.. _Github repo: https://github.com/phobson/probscale
51-
.. _tarball: https://github.com/phobson/probscale/tarball/master
50+
.. _Github repo: https://github.com/matplotlib/mpl-probscale
51+
.. _tarball: https://github.com/matplotlib/mpl-probscale/tarball/master

docs/tutorial/closer_look_at_plot_pos.ipynb

+5-5
Original file line numberDiff line numberDiff line change
@@ -154,8 +154,8 @@
154154
},
155155
"outputs": [],
156156
"source": [
157-
"w_opts = {'label': 'Weibull (a=0, b=0)', 'marker': 'o', 'markeredgecolor': 'b'}\n",
158-
"c_opts = {'label': 'Cunnane (a=0.4, b=0.4)', 'marker': 's', 'markeredgecolor': 'g'}\n",
157+
"w_opts = {'label': 'Weibull (α=0, β=0)', 'marker': 'o', 'markeredgecolor': 'b'}\n",
158+
"c_opts = {'label': 'Cunnane (α=0.4, β=0.4)', 'marker': 's', 'markeredgecolor': 'g'}\n",
159159
"\n",
160160
"common_opts = {\n",
161161
" 'markerfacecolor': 'none',\n",
@@ -198,7 +198,7 @@
198198
},
199199
"outputs": [],
200200
"source": [
201-
"h_opts = {'label': 'Hazen (a=0.5, b=0.5)', 'marker': '^', 'markeredgecolor': 'r'}\n",
201+
"h_opts = {'label': 'Hazen (α=0.5, β=0.5)', 'marker': '^', 'markeredgecolor': 'r'}\n",
202202
"fig, (ax1, ax2) = pyplot.subplots(figsize=(10, 8), ncols=2, sharex=True, sharey=False)\n",
203203
"\n",
204204
"for dist, ax in zip([None, weibull], [ax1, ax2]):\n",
@@ -280,9 +280,9 @@
280280
"metadata": {
281281
"anaconda-cloud": {},
282282
"kernelspec": {
283-
"display_name": "probscale",
283+
"display_name": "Python [default]",
284284
"language": "python",
285-
"name": "probscale"
285+
"name": "python3"
286286
},
287287
"language_info": {
288288
"codemirror_mode": {

docs/tutorial/closer_look_at_viz.ipynb

+40-36
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@
9090
"ax.set_xlabel('Percentile')\n",
9191
"ax.set_ylabel('Total Bill (USD)')\n",
9292
"ax.set_yscale('log')\n",
93-
"ax.legend(loc='upper left')\n",
93+
"ax.set_ylim(bottom=1, top=100)\n",
9494
"seaborn.despine()"
9595
]
9696
},
@@ -113,6 +113,7 @@
113113
"fig = probscale.probplot(tips['total_bill'], ax=ax, plottype='pp', datascale='log',\n",
114114
" problabel='Percentile', datalabel='Total Bill (USD)',\n",
115115
" scatter_kws=dict(marker='.', linestyle='none', label='Bill Amount'))\n",
116+
"ax.set_ylim(bottom=1, top=100)\n",
116117
"seaborn.despine()"
117118
]
118119
},
@@ -148,7 +149,7 @@
148149
"ax.set_xlabel('Normal Quantiles')\n",
149150
"ax.set_ylabel('Total Bill (USD)')\n",
150151
"ax.set_yscale('log')\n",
151-
"ax.legend(loc='upper left')\n",
152+
"ax.set_ylim(bottom=1, top=100)\n",
152153
"seaborn.despine()"
153154
]
154155
},
@@ -169,9 +170,10 @@
169170
"source": [
170171
"fig, ax = pyplot.subplots(figsize=(6, 3))\n",
171172
"fig = probscale.probplot(tips['total_bill'], ax=ax, plottype='qq', datascale='log', \n",
172-
" problabel='Normal Quantiles', datalabel='Total Bill (USD)',\n",
173+
" problabel='Standard Normal Quantiles', datalabel='Total Bill (USD)',\n",
173174
" scatter_kws=dict(marker='.', linestyle='none', label='Bill Amount'))\n",
174-
"ax.legend(loc='upper left')\n",
175+
"\n",
176+
"ax.set_ylim(bottom=1, top=100)\n",
175177
"seaborn.despine()"
176178
]
177179
},
@@ -194,15 +196,17 @@
194196
"outputs": [],
195197
"source": [
196198
"fig, (ax1, ax2) = pyplot.subplots(figsize=(6, 6), ncols=2, sharex=True)\n",
199+
"markers = dict(marker='.', linestyle='none', label='Bill Amount')\n",
197200
"\n",
198201
"fig = probscale.probplot(tips['total_bill'], ax=ax1, plottype='pp', probax='y',\n",
199-
" datascale='log', problabel='Percentile', datalabel='Total Bill (USD)',\n",
200-
" scatter_kws=dict(marker='.', linestyle='none', label='Bill Amount'))\n",
202+
" datascale='log', problabel='Percentiles',\n",
203+
" datalabel='Total Bill (USD)', scatter_kws=markers)\n",
201204
"\n",
202205
"fig = probscale.probplot(tips['total_bill'], ax=ax2, plottype='qq', probax='y',\n",
203-
" datascale='log', problabel='Normal Quantiles', datalabel='Total Bill (USD)',\n",
204-
" scatter_kws=dict(marker='.', linestyle='none', label='Bill Amount'))\n",
205-
"ax.legend(loc='upper left')\n",
206+
" datascale='log', problabel='Standard Normal Quantiles',\n",
207+
" datalabel='Total Bill (USD)', scatter_kws=markers)\n",
208+
"\n",
209+
"ax1.set_xlim(left=1, right=100)\n",
206210
"fig.tight_layout()\n",
207211
"seaborn.despine()"
208212
]
@@ -239,20 +243,16 @@
239243
" scatter_kws=dict(marker='.', linestyle='none')\n",
240244
")\n",
241245
"\n",
242-
"fig = probscale.probplot(tips['total_bill'], ax=ax1, \n",
243-
" plottype='pp',\n",
244-
" problabel='percentile', \n",
245-
" **common_opts)\n",
246+
"fig = probscale.probplot(tips['total_bill'], ax=ax1, plottype='pp',\n",
247+
" problabel='Percentiles', **common_opts)\n",
246248
"\n",
247-
"fig = probscale.probplot(tips['total_bill'], ax=ax2, \n",
248-
" plottype='qq',\n",
249-
" problabel='Normal Quantiles', \n",
250-
" **common_opts)\n",
249+
"fig = probscale.probplot(tips['total_bill'], ax=ax2, plottype='qq',\n",
250+
" problabel='Standard Normal Quantiles', **common_opts)\n",
251251
"\n",
252-
"fig = probscale.probplot(tips['total_bill'], ax=ax3, \n",
253-
" plottype='prob',\n",
254-
" problabel='Normal Probabilities', \n",
255-
" **common_opts)\n",
252+
"fig = probscale.probplot(tips['total_bill'], ax=ax3, plottype='prob',\n",
253+
" problabel='Standard Normal Probabilities', **common_opts)\n",
254+
"\n",
255+
"ax3.set_xlim(left=1, right=100)\n",
256256
"ax3.set_ylim(bottom=0.13, top=99.87)\n",
257257
"fig.tight_layout()\n",
258258
"seaborn.despine()"
@@ -291,17 +291,19 @@
291291
"alpha = stats.alpha(10)\n",
292292
"beta = stats.beta(6, 3)\n",
293293
"\n",
294-
"fig, (ax1, ax2, ax3) = pyplot.subplots(figsize=(9, 6), ncols=3, sharey=True)\n",
294+
"fig, (ax1, ax2, ax3) = pyplot.subplots(figsize=(9, 6), ncols=3, sharex=True)\n",
295295
"fig = probscale.probplot(tips['total_bill'], ax=ax1, dist=alpha, \n",
296-
" problabel='Alpha Probabilities', **common_opts)\n",
296+
" problabel='Alpha(10) Probabilities', **common_opts)\n",
297297
"\n",
298298
"fig = probscale.probplot(tips['total_bill'], ax=ax2, dist=beta, \n",
299-
" problabel='Beta Probabilities', **common_opts)\n",
299+
" problabel='Beta(6, 1) Probabilities', **common_opts)\n",
300300
"\n",
301301
"fig = probscale.probplot(tips['total_bill'], ax=ax3, dist=None,\n",
302-
" problabel='Normal Probabilities', **common_opts)\n",
302+
" problabel='Standard Normal Probabilities', **common_opts)\n",
303303
"\n",
304-
"ax3.set_ylim(bottom=0.2, top=99.8)\n",
304+
"ax3.set_xlim(left=1, right=100)\n",
305+
"for ax in [ax1, ax2, ax3]:\n",
306+
" ax.set_ylim(bottom=0.2, top=99.8)\n",
305307
"seaborn.despine()\n",
306308
"fig.tight_layout()"
307309
]
@@ -332,18 +334,17 @@
332334
"alpha = stats.alpha(10)\n",
333335
"beta = stats.beta(6, 3)\n",
334336
"\n",
335-
"fig, (ax1, ax2, ax3) = pyplot.subplots(figsize=(9, 6), ncols=3)\n",
337+
"fig, (ax1, ax2, ax3) = pyplot.subplots(figsize=(9, 6), ncols=3, sharex=True)\n",
336338
"fig = probscale.probplot(tips['total_bill'], ax=ax1, dist=alpha, \n",
337-
" problabel='Alpha Quantiles', **common_opts)\n",
339+
" problabel='Alpha(10) Quantiles', **common_opts)\n",
338340
"\n",
339341
"fig = probscale.probplot(tips['total_bill'], ax=ax2, dist=beta, \n",
340-
" problabel='Beta Quantiles', **common_opts)\n",
342+
" problabel='Beta(6, 3) Quantiles', **common_opts)\n",
341343
"\n",
342344
"fig = probscale.probplot(tips['total_bill'], ax=ax3, dist=None,\n",
343-
" problabel='Normal Quantiles', **common_opts)\n",
345+
" problabel='Standard Normal Quantiles', **common_opts)\n",
344346
"\n",
345-
"ax.legend(loc='upper left')\n",
346-
"ax.set_ylim(bottom=0.1, top=99.9)\n",
347+
"ax1.set_xlim(left=1, right=100)\n",
347348
"seaborn.despine()\n",
348349
"fig.tight_layout()"
349350
]
@@ -494,6 +495,7 @@
494495
" line_kws=dict(label='Best-fit line'))\n",
495496
"ax.legend(loc='upper left')\n",
496497
"ax.set_ylim(bottom=0.1, top=99.9)\n",
498+
"ax.set_xlim(left=1, right=100)\n",
497499
"seaborn.despine()"
498500
]
499501
},
@@ -524,6 +526,7 @@
524526
" scatter_kws={'label': 'Observations'},\n",
525527
" problabel='Probability (%)')\n",
526528
"ax.legend(loc='lower right')\n",
529+
"ax.set_ylim(bottom=-2, top=4)\n",
527530
"seaborn.despine(fig)"
528531
]
529532
},
@@ -566,7 +569,8 @@
566569
"numpy.random.seed(0)\n",
567570
"x = numpy.random.normal(size=15)\n",
568571
"\n",
569-
"fig, (ax1, ax2, ax3) = pyplot.subplots(figsize=(6, 6), nrows=3, sharex=True)\n",
572+
"fig, (ax1, ax2, ax3) = pyplot.subplots(figsize=(6, 6), nrows=3,\n",
573+
" sharey=True, sharex=True)\n",
570574
"fig = probscale.probplot(x, ax=ax1, problabel='Cunnuane (default) plotting positions',\n",
571575
" **common_opts)\n",
572576
"\n",
@@ -697,7 +701,7 @@
697701
"outputs": [],
698702
"source": [
699703
"fg = (\n",
700-
" seaborn.FacetGrid(data=tips, hue='sex', row='smoker', col='time', aspect=1.5, margin_titles=True)\n",
704+
" seaborn.FacetGrid(data=tips, hue='sex', row='smoker', col='time', margin_titles=True, size=4)\n",
701705
" .map(probscale.probplot, 'total_bill', probax='y', bestfit=True)\n",
702706
" .set_ylabels('Probability')\n",
703707
" .add_legend()\n",
@@ -708,9 +712,9 @@
708712
"metadata": {
709713
"anaconda-cloud": {},
710714
"kernelspec": {
711-
"display_name": "probscale",
715+
"display_name": "Python [default]",
712716
"language": "python",
713-
"name": "probscale"
717+
"name": "python3"
714718
},
715719
"language_info": {
716720
"codemirror_mode": {

docs/tutorial/getting_started.ipynb

+9-9
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"\n",
99
"## Installation\n",
1010
"\n",
11-
"`mpl-probscale` is developed on Python 3.5. It is also tested on Python 3.4 and even 2.7 (for the time being).\n",
11+
"`mpl-probscale` is developed on Python 3.6. It is also tested on Python 3.4, 3.5, and even 2.7 (for the time being).\n",
1212
"\n",
1313
"### From conda\n",
1414
"Official releases of `mpl-probscale` can be found on conda-forge:\n",
@@ -17,7 +17,7 @@
1717
"\n",
1818
"Fairly recent builds of the development verions are available on my channel:\n",
1919
"\n",
20-
"`conda install --channel=phobson mpl-probscale`\n",
20+
"`conda install --channel=conda-forge mpl-probscale`\n",
2121
"\n",
2222
"\n",
2323
"### From PyPI\n",
@@ -27,7 +27,7 @@
2727
"\n",
2828
"### From source\n",
2929
"\n",
30-
"`mpl-probscale` is a pure python package. It should be fairly trivial to install from source on any platform. To do that, download or clone from [github](https://github.com/phobson/mpl-probscale), unzip the archive if necessary then do:\n",
30+
"`mpl-probscale` is a pure python package. It should be fairly trivial to install from source on any platform. To do that, download or clone from [github](https://github.com/matplotlib/mpl-probscale), unzip the archive if necessary then do:\n",
3131
"\n",
3232
"```\n",
3333
"cd mpl-probscale # or wherever the setup.py got placed\n",
@@ -208,11 +208,11 @@
208208
"\n",
209209
"beta1 = stats.beta(a=3, b=2)\n",
210210
"ax2.set_xscale('prob', dist=beta1)\n",
211-
"ax2.set_xlabel('Beta probability scale (a=3, b=2)')\n",
211+
"ax2.set_xlabel('Beta probability scale (α=3, β=2)')\n",
212212
"\n",
213213
"beta2 = stats.beta(a=2, b=7)\n",
214214
"ax3.set_xscale('prob', dist=beta2)\n",
215-
"ax3.set_xlabel('Beta probability scale (a=2, b=7)')\n",
215+
"ax3.set_xlabel('Beta probability scale (α=2, β=7)')\n",
216216
"\n",
217217
"ax4.set_xticks(ax1.get_xticks()[12:-12])\n",
218218
"ax4.set_xlabel('Linear scale (for reference)')\n",
@@ -366,22 +366,22 @@
366366
"plot = (\n",
367367
" seaborn.load_dataset(\"tips\")\n",
368368
" .assign(pct=lambda df: 100 * df['tip'] / df['total_bill'])\n",
369-
" .pipe(seaborn.FacetGrid, hue='sex', col='time', row='smoker', margin_titles=True, aspect=1.25, size=4)\n",
369+
" .pipe(seaborn.FacetGrid, hue='sex', col='time', row='smoker', margin_titles=True, aspect=1., size=4)\n",
370370
" .map(probscale.probplot, 'pct', bestfit=True, scatter_kws=dict(alpha=0.75), probax='y')\n",
371371
" .add_legend()\n",
372372
" .set_ylabels('Non-Exceedance Probabilty')\n",
373373
" .set_xlabels('Tips as percent of total bill')\n",
374-
" .set(ylim=(0.5, 99.5))\n",
374+
" .set(ylim=(0.5, 99.5), xlim=(0, 100))\n",
375375
")"
376376
]
377377
}
378378
],
379379
"metadata": {
380380
"anaconda-cloud": {},
381381
"kernelspec": {
382-
"display_name": "probscale",
382+
"display_name": "Python [default]",
383383
"language": "python",
384-
"name": "probscale"
384+
"name": "python3"
385385
},
386386
"language_info": {
387387
"codemirror_mode": {

0 commit comments

Comments
 (0)