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

Skip to content

Commit 87bdd47

Browse files
authored
Merge pull request #14441 from anntzer/docstrings
Misc. docstring cleanups.
2 parents 146de7f + 7ef6229 commit 87bdd47

File tree

6 files changed

+15
-17
lines changed

6 files changed

+15
-17
lines changed

examples/animation/random_walk.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,14 @@
1515

1616
def gen_rand_line(length, dims=2):
1717
"""
18-
Create a line using a random walk algorithm
19-
20-
length is the number of points for the line.
21-
dims is the number of dimensions the line has.
18+
Create a line using a random walk algorithm.
19+
20+
Parameters
21+
----------
22+
length : int
23+
The number of points of the line.
24+
dims : int
25+
The number of dimensions of the line.
2226
"""
2327
line_data = np.empty((dims, length))
2428
line_data[:, 0] = np.random.rand(dims)

examples/animation/strip_chart.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ def update(self, y):
4040

4141

4242
def emitter(p=0.03):
43-
'return a random value with probability p, else 0'
43+
"""Return a random value in [0, 1) with probability p, else 0."""
4444
while True:
4545
v = np.random.rand(1)
4646
if v > p:

examples/axisartist/demo_axis_direction.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,7 @@
1919

2020

2121
def setup_axes(fig, rect):
22-
"""
23-
polar projection, but in a rectangular box.
24-
"""
22+
"""Polar projection, but in a rectangular box."""
2523

2624
# see demo_curvelinear_grid.py for details
2725
tr = Affine2D().scale(np.pi/180., 1.) + PolarAxes.PolarTransform()

examples/axisartist/demo_curvelinear_grid2.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,7 @@
2222

2323

2424
def curvelinear_test1(fig):
25-
"""
26-
grid for custom transform.
27-
"""
25+
"""Grid for custom transform."""
2826

2927
def tr(x, y):
3028
sgn = np.sign(x)

examples/axisartist/simple_axis_pad.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,7 @@
1919

2020

2121
def setup_axes(fig, rect):
22-
"""
23-
polar projection, but in a rectangular box.
24-
"""
22+
"""Polar projection, but in a rectangular box."""
2523

2624
# see demo_curvelinear_grid.py for details
2725
tr = Affine2D().scale(np.pi/180., 1.) + PolarAxes.PolarTransform()

examples/event_handling/pick_event_demo2.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
Pick Event Demo2
44
================
55
6-
compute the mean and standard deviation (stddev) of 100 data sets and plot
7-
mean vs stddev. When you click on one of the mu, sigma points, plot the raw
8-
data from the dataset that generated the mean and stddev.
6+
Compute the mean (mu) and standard deviation (sigma) of 100 data sets and plot
7+
mu vs. sigma. When you click on one of the (mu, sigma) points, plot the raw
8+
data from the dataset that generated this point.
99
"""
1010
import numpy as np
1111
import matplotlib.pyplot as plt

0 commit comments

Comments
 (0)