|
94 | 94 | "cell_type": "markdown",
|
95 | 95 | "metadata": {},
|
96 | 96 | "source": [
|
97 |
| - "Using the `probplot` function with `axtype='pp'`, it becomes:" |
| 97 | + "Using the `probplot` function with `plottype='pp'`, it becomes:" |
98 | 98 | ]
|
99 | 99 | },
|
100 | 100 | {
|
|
106 | 106 | "outputs": [],
|
107 | 107 | "source": [
|
108 | 108 | "fig, ax = pyplot.subplots(figsize=(6, 3))\n",
|
109 |
| - "fig = probscale.probplot(tips['total_bill'], ax=ax, axtype='pp',\n", |
110 |
| - " otherscale='log', label='Bill Amount', \n", |
| 109 | + "fig = probscale.probplot(tips['total_bill'], ax=ax, plottype='pp',\n", |
| 110 | + " datascale='log', label='Bill Amount', \n", |
111 | 111 | " xlabel='Percentile', ylabel='Total Bill (USD)',\n",
|
112 | 112 | " scatter_kws=dict(marker='.', linestyle='none'))\n",
|
113 | 113 | "ax.legend()\n",
|
|
166 | 166 | "outputs": [],
|
167 | 167 | "source": [
|
168 | 168 | "fig, ax = pyplot.subplots(figsize=(6, 3))\n",
|
169 |
| - "fig = probscale.probplot(tips['total_bill'], ax=ax, axtype='qq',\n", |
170 |
| - " otherscale='log', label='Bill Amount', \n", |
| 169 | + "fig = probscale.probplot(tips['total_bill'], ax=ax, plottype='qq',\n", |
| 170 | + " datascale='log', label='Bill Amount', \n", |
171 | 171 | " xlabel='Normal Quantiles', ylabel='Total Bill (USD)',\n",
|
172 | 172 | " scatter_kws=dict(marker='.', linestyle='none'))\n",
|
173 | 173 | "ax.legend()\n",
|
|
194 | 194 | "source": [
|
195 | 195 | "fig, (ax1, ax2) = pyplot.subplots(figsize=(6, 6), ncols=2, sharex=True)\n",
|
196 | 196 | "\n",
|
197 |
| - "fig = probscale.probplot(tips['total_bill'], ax=ax1, axtype='pp', probax='y',\n", |
198 |
| - " otherscale='log', label='Bill Amount', \n", |
| 197 | + "fig = probscale.probplot(tips['total_bill'], ax=ax1, plottype='pp', probax='y',\n", |
| 198 | + " datascale='log', label='Bill Amount', \n", |
199 | 199 | " ylabel='Percentile', xlabel='Total Bill (USD)',\n",
|
200 | 200 | " scatter_kws=dict(marker='.', linestyle='none'))\n",
|
201 | 201 | "ax.legend()\n",
|
202 | 202 | "\n",
|
203 |
| - "fig = probscale.probplot(tips['total_bill'], ax=ax2, axtype='qq', probax='y',\n", |
204 |
| - " otherscale='log', label='Bill Amount', \n", |
| 203 | + "fig = probscale.probplot(tips['total_bill'], ax=ax2, plottype='qq', probax='y',\n", |
| 204 | + " datascale='log', label='Bill Amount', \n", |
205 | 205 | " ylabel='Normal Quantiles', xlabel='Total Bill (USD)',\n",
|
206 | 206 | " scatter_kws=dict(marker='.', linestyle='none'))\n",
|
207 | 207 | "ax.legend()\n",
|
|
236 | 236 | "fig, (ax1, ax2, ax3) = pyplot.subplots(figsize=(9, 6), ncols=3, sharex=True)\n",
|
237 | 237 | "common_opts = dict(\n",
|
238 | 238 | " probax='y', \n",
|
239 |
| - " otherscale='log', \n", |
| 239 | + " datascale='log', \n", |
240 | 240 | " label='Bill Amount', \n",
|
241 | 241 | " xlabel='Total Bill (USD)',\n",
|
242 | 242 | " scatter_kws=dict(marker='.', linestyle='none')\n",
|
243 | 243 | ")\n",
|
244 | 244 | "\n",
|
245 | 245 | "fig = probscale.probplot(tips['total_bill'], ax=ax1, \n",
|
246 |
| - " axtype='pp',\n", |
| 246 | + " plottype='pp',\n", |
247 | 247 | " ylabel='percentile', \n",
|
248 | 248 | " **common_opts)\n",
|
249 | 249 | "\n",
|
250 | 250 | "fig = probscale.probplot(tips['total_bill'], ax=ax2, \n",
|
251 |
| - " axtype='qq',\n", |
| 251 | + " plottype='qq',\n", |
252 | 252 | " ylabel='Normal Quantiles', \n",
|
253 | 253 | " **common_opts)\n",
|
254 | 254 | "\n",
|
255 | 255 | "fig = probscale.probplot(tips['total_bill'], ax=ax3, \n",
|
256 |
| - " axtype='prob',\n", |
| 256 | + " plottype='prob',\n", |
257 | 257 | " ylabel='Normal Probabilities', \n",
|
258 | 258 | " **common_opts)\n",
|
259 | 259 | "ax3.set_ylim(bottom=0.13, top=99.87)\n",
|
|
285 | 285 | "outputs": [],
|
286 | 286 | "source": [
|
287 | 287 | "common_opts = dict(\n",
|
288 |
| - " axtype='prob',\n", |
| 288 | + " plottype='prob',\n", |
289 | 289 | " probax='y',\n",
|
290 |
| - " otherscale='log',\n", |
| 290 | + " datascale='log',\n", |
291 | 291 | " label='Bill Amount',\n",
|
292 | 292 | " xlabel='Total Bill (USD)',\n",
|
293 | 293 | " scatter_kws=dict(marker='+', linestyle='none', mew=1)\n",
|
|
328 | 328 | "outputs": [],
|
329 | 329 | "source": [
|
330 | 330 | "common_opts = dict(\n",
|
331 |
| - " axtype='qq',\n", |
| 331 | + " plottype='qq',\n", |
332 | 332 | " probax='y',\n",
|
333 |
| - " otherscale='log',\n", |
| 333 | + " datascale='log',\n", |
334 | 334 | " label='Bill Amount',\n",
|
335 | 335 | " xlabel='Total Bill (USD)',\n",
|
336 | 336 | " scatter_kws=dict(marker='+', linestyle='none', mew=1)\n",
|
|
387 | 387 | "ax.set_aspect('equal')\n",
|
388 | 388 | "\n",
|
389 | 389 | "common_opts = dict(\n",
|
390 |
| - " axtype='qq',\n", |
| 390 | + " plottype='qq',\n", |
391 | 391 | " probax='y',\n",
|
392 | 392 | " ylabel='Theoretical Quantiles',\n",
|
393 | 393 | " xlabel='Emperical Quantiles',\n",
|
|
447 | 447 | "Adding a best-fit line to a probability plot can provide insight as to whether or not a dataset can be characterized by a distribution.\n",
|
448 | 448 | "\n",
|
449 | 449 | "This is simply done with the `bestfit=True` option in `probplot`.\n",
|
450 |
| - "Behind the scenes, `probplot` transforms both the x- and y-data of fed to the regression based on the plot type and scale of the data axis (controlled via `otherscale`). \n", |
| 450 | + "Behind the scenes, `probplot` transforms both the x- and y-data of fed to the regression based on the plot type and scale of the data axis (controlled via `datascale`). \n", |
451 | 451 | "\n",
|
452 | 452 | "Visual attributes of the line can be controled with the `line_kws` parameter.\n",
|
453 | 453 | "If you want label the best-fit line, that is where you specify its label.\n",
|
|
464 | 464 | "outputs": [],
|
465 | 465 | "source": [
|
466 | 466 | "fig, ax = pyplot.subplots(figsize=(6, 3))\n",
|
467 |
| - "fig = probscale.probplot(tips['total_bill'], ax=ax, axtype='pp', bestfit=True,\n", |
| 467 | + "fig = probscale.probplot(tips['total_bill'], ax=ax, plottype='pp', bestfit=True,\n", |
468 | 468 | " label='Bill Amount', xlabel='Percentile', ylabel='Total Bill (USD)',\n",
|
469 | 469 | " scatter_kws=dict(marker='.', linestyle='none', alpha=0.5),\n",
|
470 | 470 | " line_kws=dict(label='Best-fit line', linestyle='--', linewidth=2.5))\n",
|
|
492 | 492 | "outputs": [],
|
493 | 493 | "source": [
|
494 | 494 | "fig, ax = pyplot.subplots(figsize=(4, 6))\n",
|
495 |
| - "fig = probscale.probplot(tips['total_bill'], ax=ax, axtype='prob', bestfit=True, \n", |
496 |
| - " probax='y', otherscale='log',label='Bill Amount',\n", |
| 495 | + "fig = probscale.probplot(tips['total_bill'], ax=ax, plottype='prob', bestfit=True, \n", |
| 496 | + " probax='y', datascale='log',label='Bill Amount',\n", |
497 | 497 | " ylabel='Probabilities', xlabel='Total Bill (USD)',\n",
|
498 | 498 | " scatter_kws=dict(marker='+', linestyle='none', alpha=0.75, mew=1),\n",
|
499 | 499 | " line_kws=dict(label='Best-fit line', linewidth=2.5, zorder=0))\n",
|
|
556 | 556 | "outputs": [],
|
557 | 557 | "source": [
|
558 | 558 | "common_opts = dict(\n",
|
559 |
| - " axtype='prob',\n", |
| 559 | + " plottype='prob',\n", |
560 | 560 | " probax='x',\n",
|
561 | 561 | " label='Bill Amount',\n",
|
562 | 562 | " ylabel='Data',\n",
|
|
613 | 613 | "outputs": [],
|
614 | 614 | "source": [
|
615 | 615 | "fg = seaborn.FacetGrid(data=iris, hue='species', aspect=2)\n",
|
616 |
| - "fg.map(probscale.probplot, 'petal_length', axtype='qq', probax='y')\n", |
| 616 | + "fg.map(probscale.probplot, 'petal_length', plottype='qq', probax='y')\n", |
617 | 617 | "fg.set_ylabels('Quantiles')"
|
618 | 618 | ]
|
619 | 619 | },
|
|
0 commit comments