1717
1818
1919def plot_scatter (ax , prng , nb_samples = 100 ):
20- """Scatter plot.
21- """
20+ """Scatter plot."""
2221 for mu , sigma , marker in [(- .5 , 0.75 , 'o' ), (0.75 , 1. , 's' )]:
2322 x , y = prng .normal (loc = mu , scale = sigma , size = (2 , nb_samples ))
2423 ax .plot (x , y , ls = 'none' , marker = marker )
@@ -28,8 +27,7 @@ def plot_scatter(ax, prng, nb_samples=100):
2827
2928
3029def plot_colored_sinusoidal_lines (ax ):
31- """Plot sinusoidal lines with colors following the style color cycle.
32- """
30+ """Plot sinusoidal lines with colors following the style color cycle."""
3331 L = 2 * np .pi
3432 x = np .linspace (0 , L )
3533 nb_colors = len (plt .rcParams ['axes.prop_cycle' ])
@@ -41,8 +39,7 @@ def plot_colored_sinusoidal_lines(ax):
4139
4240
4341def plot_bar_graphs (ax , prng , min_value = 5 , max_value = 25 , nb_samples = 5 ):
44- """Plot two bar graphs side by side, with letters as x-tick labels.
45- """
42+ """Plot two bar graphs side by side, with letters as x-tick labels."""
4643 x = np .arange (nb_samples )
4744 ya , yb = prng .randint (min_value , max_value , size = (2 , nb_samples ))
4845 width = 0.25
@@ -54,7 +51,8 @@ def plot_bar_graphs(ax, prng, min_value=5, max_value=25, nb_samples=5):
5451
5552
5653def plot_colored_circles (ax , prng , nb_samples = 15 ):
57- """Plot circle patches.
54+ """
55+ Plot circle patches.
5856
5957 NB: draws a fixed amount of samples, rather than using the length of
6058 the color cycle, because different styles may have different numbers
@@ -72,8 +70,7 @@ def plot_colored_circles(ax, prng, nb_samples=15):
7270
7371
7472def plot_image_and_patch (ax , prng , size = (20 , 20 )):
75- """Plot an image with random values and superimpose a circular patch.
76- """
73+ """Plot an image with random values and superimpose a circular patch."""
7774 values = prng .random_sample (size = size )
7875 ax .imshow (values , interpolation = 'none' )
7976 c = plt .Circle ((5 , 5 ), radius = 5 , label = 'patch' )
@@ -84,8 +81,7 @@ def plot_image_and_patch(ax, prng, size=(20, 20)):
8481
8582
8683def plot_histograms (ax , prng , nb_samples = 10000 ):
87- """Plot 4 histograms and a text annotation.
88- """
84+ """Plot 4 histograms and a text annotation."""
8985 params = ((10 , 10 ), (4 , 12 ), (50 , 12 ), (6 , 55 ))
9086 for a , b in params :
9187 values = prng .beta (a , b , size = nb_samples )
@@ -104,8 +100,7 @@ def plot_histograms(ax, prng, nb_samples=10000):
104100
105101
106102def plot_figure (style_label = "" ):
107- """Setup and plot the demonstration figure with a given style.
108- """
103+ """Setup and plot the demonstration figure with a given style."""
109104 # Use a dedicated RandomState instance to draw the same "random" values
110105 # across the different figures.
111106 prng = np .random .RandomState (96917002 )
0 commit comments