|
90 | 90 | "ax.set_xlabel('Percentile')\n",
|
91 | 91 | "ax.set_ylabel('Total Bill (USD)')\n",
|
92 | 92 | "ax.set_yscale('log')\n",
|
93 |
| - "ax.legend(loc='upper left')\n", |
| 93 | + "ax.set_ylim(bottom=1, top=100)\n", |
94 | 94 | "seaborn.despine()"
|
95 | 95 | ]
|
96 | 96 | },
|
|
113 | 113 | "fig = probscale.probplot(tips['total_bill'], ax=ax, plottype='pp', datascale='log',\n",
|
114 | 114 | " problabel='Percentile', datalabel='Total Bill (USD)',\n",
|
115 | 115 | " scatter_kws=dict(marker='.', linestyle='none', label='Bill Amount'))\n",
|
| 116 | + "ax.set_ylim(bottom=1, top=100)\n", |
116 | 117 | "seaborn.despine()"
|
117 | 118 | ]
|
118 | 119 | },
|
|
148 | 149 | "ax.set_xlabel('Normal Quantiles')\n",
|
149 | 150 | "ax.set_ylabel('Total Bill (USD)')\n",
|
150 | 151 | "ax.set_yscale('log')\n",
|
151 |
| - "ax.legend(loc='upper left')\n", |
| 152 | + "ax.set_ylim(bottom=1, top=100)\n", |
152 | 153 | "seaborn.despine()"
|
153 | 154 | ]
|
154 | 155 | },
|
|
169 | 170 | "source": [
|
170 | 171 | "fig, ax = pyplot.subplots(figsize=(6, 3))\n",
|
171 | 172 | "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", |
173 | 174 | " 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", |
175 | 177 | "seaborn.despine()"
|
176 | 178 | ]
|
177 | 179 | },
|
|
194 | 196 | "outputs": [],
|
195 | 197 | "source": [
|
196 | 198 | "fig, (ax1, ax2) = pyplot.subplots(figsize=(6, 6), ncols=2, sharex=True)\n",
|
| 199 | + "markers = dict(marker='.', linestyle='none', label='Bill Amount')\n", |
197 | 200 | "\n",
|
198 | 201 | "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", |
201 | 204 | "\n",
|
202 | 205 | "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", |
206 | 210 | "fig.tight_layout()\n",
|
207 | 211 | "seaborn.despine()"
|
208 | 212 | ]
|
|
239 | 243 | " scatter_kws=dict(marker='.', linestyle='none')\n",
|
240 | 244 | ")\n",
|
241 | 245 | "\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", |
246 | 248 | "\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", |
251 | 251 | "\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", |
256 | 256 | "ax3.set_ylim(bottom=0.13, top=99.87)\n",
|
257 | 257 | "fig.tight_layout()\n",
|
258 | 258 | "seaborn.despine()"
|
|
291 | 291 | "alpha = stats.alpha(10)\n",
|
292 | 292 | "beta = stats.beta(6, 3)\n",
|
293 | 293 | "\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", |
295 | 295 | "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", |
297 | 297 | "\n",
|
298 | 298 | "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", |
300 | 300 | "\n",
|
301 | 301 | "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", |
303 | 303 | "\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", |
305 | 307 | "seaborn.despine()\n",
|
306 | 308 | "fig.tight_layout()"
|
307 | 309 | ]
|
|
332 | 334 | "alpha = stats.alpha(10)\n",
|
333 | 335 | "beta = stats.beta(6, 3)\n",
|
334 | 336 | "\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", |
336 | 338 | "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", |
338 | 340 | "\n",
|
339 | 341 | "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", |
341 | 343 | "\n",
|
342 | 344 | "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", |
344 | 346 | "\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", |
347 | 348 | "seaborn.despine()\n",
|
348 | 349 | "fig.tight_layout()"
|
349 | 350 | ]
|
|
494 | 495 | " line_kws=dict(label='Best-fit line'))\n",
|
495 | 496 | "ax.legend(loc='upper left')\n",
|
496 | 497 | "ax.set_ylim(bottom=0.1, top=99.9)\n",
|
| 498 | + "ax.set_xlim(left=1, right=100)\n", |
497 | 499 | "seaborn.despine()"
|
498 | 500 | ]
|
499 | 501 | },
|
|
524 | 526 | " scatter_kws={'label': 'Observations'},\n",
|
525 | 527 | " problabel='Probability (%)')\n",
|
526 | 528 | "ax.legend(loc='lower right')\n",
|
| 529 | + "ax.set_ylim(bottom=-2, top=4)\n", |
527 | 530 | "seaborn.despine(fig)"
|
528 | 531 | ]
|
529 | 532 | },
|
|
566 | 569 | "numpy.random.seed(0)\n",
|
567 | 570 | "x = numpy.random.normal(size=15)\n",
|
568 | 571 | "\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", |
570 | 574 | "fig = probscale.probplot(x, ax=ax1, problabel='Cunnuane (default) plotting positions',\n",
|
571 | 575 | " **common_opts)\n",
|
572 | 576 | "\n",
|
|
697 | 701 | "outputs": [],
|
698 | 702 | "source": [
|
699 | 703 | "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", |
701 | 705 | " .map(probscale.probplot, 'total_bill', probax='y', bestfit=True)\n",
|
702 | 706 | " .set_ylabels('Probability')\n",
|
703 | 707 | " .add_legend()\n",
|
|
708 | 712 | "metadata": {
|
709 | 713 | "anaconda-cloud": {},
|
710 | 714 | "kernelspec": {
|
711 |
| - "display_name": "probscale", |
| 715 | + "display_name": "Python [default]", |
712 | 716 | "language": "python",
|
713 |
| - "name": "probscale" |
| 717 | + "name": "python3" |
714 | 718 | },
|
715 | 719 | "language_info": {
|
716 | 720 | "codemirror_mode": {
|
|
0 commit comments