Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit a49416a

Browse files
committed
add references to statistics examples
1 parent 7a0d656 commit a49416a

21 files changed

+260
-1
lines changed

.flake8

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -288,3 +288,4 @@ per-file-ignores =
288288
examples/userdemo/custom_boxstyle01.py: E402
289289
examples/userdemo/pgf_preamble_sgskip.py: E402
290290
examples/widgets/*.py: E402
291+
examples/statistics/*.py: E402

examples/statistics/boxplot.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,3 +95,16 @@
9595
fig.suptitle("I never said they'd be pretty")
9696
fig.subplots_adjust(hspace=0.4)
9797
plt.show()
98+
99+
#############################################################################
100+
#
101+
# ------------
102+
#
103+
# References
104+
# """"""""""
105+
#
106+
# The use of the following functions and methods is shown in this example:
107+
108+
import matplotlib
109+
matplotlib.axes.Axes.boxplot
110+
matplotlib.pyplot.boxplot

examples/statistics/boxplot_color.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,3 +51,16 @@
5151
ax.set_ylabel('Observed values')
5252

5353
plt.show()
54+
55+
#############################################################################
56+
#
57+
# ------------
58+
#
59+
# References
60+
# """"""""""
61+
#
62+
# The use of the following functions and methods is shown in this example:
63+
64+
import matplotlib
65+
matplotlib.axes.Axes.boxplot
66+
matplotlib.pyplot.boxplot

examples/statistics/boxplot_demo.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -230,3 +230,17 @@ def fake_bootstrapper(n):
230230
plt.setp(bp['whiskers'], color='k', linestyle='-')
231231
plt.setp(bp['fliers'], markersize=3.0)
232232
plt.show()
233+
234+
#############################################################################
235+
#
236+
# ------------
237+
#
238+
# References
239+
# """"""""""
240+
#
241+
# The use of the following functions and methods is shown in this example:
242+
243+
import matplotlib
244+
matplotlib.axes.Axes.boxplot
245+
matplotlib.pyplot.boxplot
246+
matplotlib.axes.Axes.set

examples/statistics/boxplot_vs_violin.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,3 +53,18 @@
5353
plt.setp(axs, xticks=[y + 1 for y in range(len(all_data))],
5454
xticklabels=['x1', 'x2', 'x3', 'x4'])
5555
plt.show()
56+
57+
#############################################################################
58+
#
59+
# ------------
60+
#
61+
# References
62+
# """"""""""
63+
#
64+
# The use of the following functions and methods is shown in this example:
65+
66+
import matplotlib
67+
matplotlib.axes.Axes.boxplot
68+
matplotlib.pyplot.boxplot
69+
matplotlib.axes.Axes.violinplot
70+
matplotlib.pyplot.violinplot

examples/statistics/bxp.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,3 +102,16 @@
102102
fig.suptitle("I never said they'd be pretty")
103103
fig.subplots_adjust(hspace=0.4)
104104
plt.show()
105+
106+
#############################################################################
107+
#
108+
# ------------
109+
#
110+
# References
111+
# """"""""""
112+
#
113+
# The use of the following functions and methods is shown in this example:
114+
115+
import matplotlib
116+
matplotlib.axes.Axes.bxp
117+
matplotlib.cbook.boxplot_stats

examples/statistics/confidence_ellipse.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -214,3 +214,16 @@ def get_correlated_dataset(n, dependency, mu, scale):
214214

215215
fig.subplots_adjust(hspace=0.25)
216216
plt.show()
217+
218+
#############################################################################
219+
#
220+
# ------------
221+
#
222+
# References
223+
# """"""""""
224+
#
225+
# The use of the following functions and methods is shown in this example:
226+
227+
import matplotlib
228+
matplotlib.transforms.Affine2D
229+
matplotlib.patches.Ellipse

examples/statistics/customized_violin.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,3 +74,18 @@ def set_axis_style(ax, labels):
7474

7575
plt.subplots_adjust(bottom=0.15, wspace=0.05)
7676
plt.show()
77+
78+
#############################################################################
79+
#
80+
# ------------
81+
#
82+
# References
83+
# """"""""""
84+
#
85+
# The use of the following functions and methods is shown in this example:
86+
87+
import matplotlib
88+
matplotlib.axes.Axes.violinplot
89+
matplotlib.pyplot.violinplot
90+
matplotlib.axes.Axes.vlines
91+
matplotlib.pyplot.vlines

examples/statistics/errorbar.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,3 +18,16 @@
1818
fig, ax = plt.subplots()
1919
ax.errorbar(x, y, xerr=0.2, yerr=0.4)
2020
plt.show()
21+
22+
#############################################################################
23+
#
24+
# ------------
25+
#
26+
# References
27+
# """"""""""
28+
#
29+
# The use of the following functions and methods is shown in this example:
30+
31+
import matplotlib
32+
matplotlib.axes.Axes.errorbar
33+
matplotlib.pyplot.errorbar

examples/statistics/errorbar_features.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,3 +45,16 @@
4545
ax1.set_title('variable, asymmetric error')
4646
ax1.set_yscale('log')
4747
plt.show()
48+
49+
#############################################################################
50+
#
51+
# ------------
52+
#
53+
# References
54+
# """"""""""
55+
#
56+
# The use of the following functions and methods is shown in this example:
57+
58+
import matplotlib
59+
matplotlib.axes.Axes.errorbar
60+
matplotlib.pyplot.errorbar

examples/statistics/errorbar_limits.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,3 +74,16 @@
7474
ax.set_xlim((0, 5.5))
7575
ax.set_title('Errorbar upper and lower limits')
7676
plt.show()
77+
78+
#############################################################################
79+
#
80+
# ------------
81+
#
82+
# References
83+
# """"""""""
84+
#
85+
# The use of the following functions and methods is shown in this example:
86+
87+
import matplotlib
88+
matplotlib.axes.Axes.errorbar
89+
matplotlib.pyplot.errorbar

examples/statistics/errorbars_and_boxes.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,3 +67,18 @@ def make_error_boxes(ax, xdata, ydata, xerror, yerror, facecolor='r',
6767
_ = make_error_boxes(ax, x, y, xerr, yerr)
6868

6969
plt.show()
70+
71+
#############################################################################
72+
#
73+
# ------------
74+
#
75+
# References
76+
# """"""""""
77+
#
78+
# The use of the following functions and methods is shown in this example:
79+
80+
import matplotlib
81+
matplotlib.axes.Axes.errorbar
82+
matplotlib.pyplot.errorbar
83+
matplotlib.axes.Axes.add_collection
84+
matplotlib.collections.PatchCollection

examples/statistics/hexbin_demo.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,3 +42,16 @@
4242
cb.set_label('log10(N)')
4343

4444
plt.show()
45+
46+
#############################################################################
47+
#
48+
# ------------
49+
#
50+
# References
51+
# """"""""""
52+
#
53+
# The use of the following functions and methods is shown in this example:
54+
55+
import matplotlib
56+
matplotlib.axes.Axes.hexbin
57+
matplotlib.pyplot.hexbin

examples/statistics/hist.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,3 +100,18 @@
100100
axs[2].hist2d(x, y, bins=(80, 10), norm=colors.LogNorm())
101101

102102
plt.show()
103+
104+
#############################################################################
105+
#
106+
# ------------
107+
#
108+
# References
109+
# """"""""""
110+
#
111+
# The use of the following functions and methods is shown in this example:
112+
113+
import matplotlib
114+
matplotlib.axes.Axes.hist
115+
matplotlib.pyplot.hist
116+
matplotlib.pyplot.hist2d
117+
matplotlib.ticker.PercentFormatter

examples/statistics/histogram_cumulative.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,3 +70,16 @@
7070
ax.set_ylabel('Likelihood of occurrence')
7171

7272
plt.show()
73+
74+
#############################################################################
75+
#
76+
# ------------
77+
#
78+
# References
79+
# """"""""""
80+
#
81+
# The use of the following functions and methods is shown in this example:
82+
83+
import matplotlib
84+
matplotlib.axes.Axes.hist
85+
matplotlib.pyplot.hist

examples/statistics/histogram_features.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
.. _section: http://docs.astropy.org/en/stable/visualization/histogram.html
2020
"""
2121

22-
import matplotlib
2322
import numpy as np
2423
import matplotlib.pyplot as plt
2524

@@ -58,7 +57,9 @@
5857
#
5958
# The use of the following functions and methods is shown in this example:
6059

60+
import matplotlib
6161
matplotlib.axes.Axes.hist
62+
matplotlib.pyplot.hist
6263
matplotlib.axes.Axes.set_title
6364
matplotlib.axes.Axes.set_xlabel
6465
matplotlib.axes.Axes.set_ylabel

examples/statistics/histogram_histtypes.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,3 +48,16 @@
4848

4949
fig.tight_layout()
5050
plt.show()
51+
52+
#############################################################################
53+
#
54+
# ------------
55+
#
56+
# References
57+
# """"""""""
58+
#
59+
# The use of the following functions and methods is shown in this example:
60+
61+
import matplotlib
62+
matplotlib.axes.Axes.hist
63+
matplotlib.pyplot.hist

examples/statistics/histogram_multihist.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,3 +44,16 @@
4444

4545
fig.tight_layout()
4646
plt.show()
47+
48+
#############################################################################
49+
#
50+
# ------------
51+
#
52+
# References
53+
# """"""""""
54+
#
55+
# The use of the following functions and methods is shown in this example:
56+
57+
import matplotlib
58+
matplotlib.axes.Axes.hist
59+
matplotlib.pyplot.hist

examples/statistics/multiple_histograms_side_by_side.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,3 +61,16 @@
6161
ax.set_xlabel("Data sets")
6262

6363
plt.show()
64+
65+
#############################################################################
66+
#
67+
# ------------
68+
#
69+
# References
70+
# """"""""""
71+
#
72+
# The use of the following functions and methods is shown in this example:
73+
74+
import matplotlib
75+
matplotlib.axes.Axes.barh
76+
matplotlib.pyplot.barh

examples/statistics/time_series_histogram.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,3 +94,17 @@
9494
toc = time.time()
9595
print(f"{toc-tic:.3f} sec. elapsed")
9696
plt.show()
97+
98+
#############################################################################
99+
#
100+
# ------------
101+
#
102+
# References
103+
# """"""""""
104+
#
105+
# The use of the following functions and methods is shown in this example:
106+
107+
import matplotlib
108+
matplotlib.axes.Axes.pcolormesh
109+
matplotlib.pyplot.pcolormesh
110+
matplotlib.figure.Figure.colorbar

examples/statistics/violinplot.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,3 +85,16 @@
8585
fig.suptitle("Violin Plotting Examples")
8686
fig.subplots_adjust(hspace=0.4)
8787
plt.show()
88+
89+
#############################################################################
90+
#
91+
# ------------
92+
#
93+
# References
94+
# """"""""""
95+
#
96+
# The use of the following functions and methods is shown in this example:
97+
98+
import matplotlib
99+
matplotlib.axes.Axes.violinplot
100+
matplotlib.pyplot.violinplot

0 commit comments

Comments
 (0)