@@ -26,15 +26,19 @@ def plot_scatter(ax, prng, nb_samples=100):
26
26
return ax
27
27
28
28
29
- def plot_colored_sinusoidal_lines (ax ):
30
- """Plot sinusoidal lines with colors following the style color cycle."""
31
- L = 2 * np .pi
32
- x = np .linspace (0 , L )
29
+ def plot_colored_lines (ax ):
30
+ """Plot lines with colors following the style color cycle."""
31
+ t = np .linspace (- 10 , 10 , 100 )
32
+
33
+ def sigmoid (t , t0 ):
34
+ return 1 / (1 + np .exp (- (t - t0 )))
35
+
33
36
nb_colors = len (plt .rcParams ['axes.prop_cycle' ])
34
- shift = np .linspace (0 , L , nb_colors , endpoint = False )
35
- for s in shift :
36
- ax .plot (x , np .sin (x + s ), '-' )
37
- ax .set_xlim ([x [0 ], x [- 1 ]])
37
+ shifts = np .linspace (- 5 , 5 , nb_colors )
38
+ amplitudes = np .linspace (1 , 1.5 , nb_colors )
39
+ for t0 , a in zip (shifts , amplitudes ):
40
+ ax .plot (t , a * sigmoid (t , t0 ), '-' )
41
+ ax .set_xlim (- 10 , 10 )
38
42
return ax
39
43
40
44
@@ -118,7 +122,7 @@ def plot_figure(style_label=""):
118
122
plot_image_and_patch (axs [1 ], prng )
119
123
plot_bar_graphs (axs [2 ], prng )
120
124
plot_colored_circles (axs [3 ], prng )
121
- plot_colored_sinusoidal_lines (axs [4 ])
125
+ plot_colored_lines (axs [4 ])
122
126
plot_histograms (axs [5 ], prng )
123
127
124
128
fig .tight_layout ()
0 commit comments