Skip to content

Commit d62f4cb

Browse files
committed
finish examples in docs
1 parent f1388af commit d62f4cb

File tree

4 files changed

+9
-8
lines changed

4 files changed

+9
-8
lines changed

probscale/probscale.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,8 +85,8 @@ class ProbScale(ScaleBase):
8585
>>> from matplotlib import pyplot
8686
>>> import probscale
8787
>>> fig, ax = pyplot.subplots()
88-
>>> ax.set_xlim(left=0.2, right=99.9)
89-
>>> ax.set_xscale('prob')
88+
>>> ax.set_ylim(bottom=0.2, top=99.9)
89+
>>> ax.set_yscale('prob')
9090
9191
"""
9292

Loading

probscale/tests/test_viz.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -393,6 +393,7 @@ def test_probplot_qq(plot_data):
393393

394394

395395
@pytest.mark.mpl_image_compare(baseline_dir=BASELINE_DIR, tolerance=10)
396+
@pytest.mark.skipif(stats is None, reason="no scipy")
396397
def test_probplot_qq_dist(plot_data):
397398
fig, ax = plt.subplots()
398399
norm = stats.norm(*stats.norm.fit(plot_data))

probscale/viz.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ def probplot(data, ax=None, plottype='prob', dist=None, probax='x',
2121
The Axes on which to plot. If one is not provided, a new Axes
2222
will be created.
2323
plottype : string (default = 'prob')
24-
Type of plot to be created. Options are:
24+
Type of plot to be created. Options are:
2525
- 'prob': probabilty plot
2626
- 'pp': percentile plot
2727
- 'qq': quantile plot
@@ -67,7 +67,7 @@ def probplot(data, ax=None, plottype='prob', dist=None, probax='x',
6767
fig : matplotlib.Figure
6868
The figure on which the plot was drawn.
6969
result : dictionary of linear fit results, optional
70-
Keys are:
70+
Keys are:
7171
- q : array of quantiles
7272
- x, y : arrays of data passed to function
7373
- xhat, yhat : arrays of modeled data plotted in best-fit line
@@ -89,6 +89,8 @@ def probplot(data, ax=None, plottype='prob', dist=None, probax='x',
8989
:context: close-figs
9090
9191
>>> import numpy; numpy.random.seed(0)
92+
>>> from matplotlib import pyplot
93+
>>> from scipy import stats
9294
>>> from probscale.viz import probplot
9395
>>> data = numpy.random.normal(loc=5, scale=1.25, size=37)
9496
>>> fig = probplot(data, plottype='prob', probax='y',
@@ -116,14 +118,12 @@ def probplot(data, ax=None, plottype='prob', dist=None, probax='x',
116118
.. plot::
117119
:context: close-figs
118120
119-
>>> from scipy import stats
120121
>>> norm = stats.norm(5, 1.25)
121-
>>> fig = probplot(data, plottype='qq', probax='x', dist=norm,
122-
... problabel='Theoretical Quantiles',
122+
>>> fig = probplot(data, ax=ax, plottype='qq', dist=norm,
123+
... probax='x', problabel='Theoretical Quantiles',
123124
... datalabel='Observed values', bestfit=True,
124125
... line_kws=dict(linestyle=':', linewidth=2),
125126
... scatter_kws=dict(marker='^', alpha=0.5))
126-
>>> fig.axes[0].set_aspect('equal')
127127
128128
"""
129129

0 commit comments

Comments
 (0)