Skip to content

Commit 8c38208

Browse files
committed
Update figures #
1 parent 694113e commit 8c38208

5 files changed

+29
-28
lines changed

02-introduction.rst

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,13 +56,14 @@ each random steps.
5656
5757
**Vectorized approach**
5858

59-
But, we can further simplifying things by considering a random walk to be
60-
composed of a number of steps and corresponding positions are the cumulative
61-
sum of these steps.
59+
But, we can further simplify things by considering a random walk to be composed
60+
of a number of steps and corresponding positions are the cumulative sum of
61+
these steps.
6262

6363
.. code:: python
6464
6565
steps = 2*np.random.randint(0, 2, size=n) - 1
6666
walk = np.cumsum(steps)
6767
68-
68+
This book is about vectorization, be it at the level of code or problem. We'll
69+
see the difference is important before looking at custom vectorization.

04-code-vectorization.rst

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ an array of cells that are connected together with the notion of neighbour and
7979
their vectorization is straightforward. Let me first define the game and we'll
8080
see how to vectorize it.
8181

82-
.. admonition:: **Figure**
82+
.. admonition:: **Figure 4.1**
8383
:class: legend
8484

8585
Conus textile snail exhibits a cellular automaton pattern on its shell.
@@ -185,7 +185,7 @@ The figure below shows 4 iterations on a 4x4 area where the initial state is a
185185
`glider <https://en.wikipedia.org/wiki/Glider_(Conway%27s_Life)>`_, a structure
186186
discovered by Richard K. Guy in 1970.
187187

188-
.. admonition:: **Figure 1**
188+
.. admonition:: **Figure 4.2**
189189
:class: legend
190190

191191
The glider pattern is known to replicate itself one step diagonally in 4
@@ -278,7 +278,7 @@ If you look at the `birth` and `survive` lines, you'll see that these two
278278
variables are arrays that can be used to set `Z` values to 1 after having
279279
cleared it.
280280

281-
.. admonition:: **Figure 2**
281+
.. admonition:: **Figure 4.3**
282282
:class: legend
283283

284284
The Game of Life. Gray levels indicate how miuch a cell has been active in
@@ -349,7 +349,7 @@ Zebrafish 0.16 0.08 0.035 0.060
349349
The figure below show some animation of the model for a specific set of parameters.
350350

351351

352-
.. admonition:: **Figure 3**
352+
.. admonition:: **Figure 4.4**
353353
:class: legend
354354

355355
Reaction-diffusion Gray-Scott model. From left to right, *Bacteria 1*, *Coral* and
@@ -417,7 +417,7 @@ which, if the number is still within some bounds, it is considerered non
417417
divergent. Of course, the more iteration you do, the more precision you get.
418418

419419

420-
.. admonition:: **Figure**
420+
.. admonition:: **Figure 4.5**
421421
:class: legend
422422

423423
Romanesco broccoli, showing self-similar form approximating a natural fractal.
@@ -555,7 +555,7 @@ escape cutoff. See reference below about the renormalization of the escape
555555
count. Here is a picture of the result where we use recount normalization,
556556
and added a power normalized colormap (gamma=0.3) as well as light shading.
557557

558-
.. admonition:: **Figure 4**
558+
.. admonition:: **Figure 4.6**
559559
:class: legend
560560

561561
The Mandelbrot as rendered by maplotlib using recount normalization, power
@@ -584,7 +584,7 @@ the exercise is to write a function using Numpy that takes a two-dimensional
584584
float array and return the dimension. We'll consider values in the array to be
585585
normalized (i.e. all values are between 0 and 1).
586586

587-
.. admonition:: **Figure 5**
587+
.. admonition:: **Figure 4.7**
588588
:class: legend
589589

590590
The Minkowski–Bouligand dimension of the Great Britain coastlines is
@@ -623,7 +623,7 @@ update at each iteration. This the case for example in particle systems where
623623
particles interact mostly with local neighbours. This is also the case for
624624
boids that simulate flocking behaviors.
625625

626-
.. admonition:: **Figure**
626+
.. admonition:: **Figure 4.8**
627627
:class: legend
628628

629629
Flocking birds are an example of self-organization in biology.
@@ -656,7 +656,7 @@ rules. The rules applied in the simplest Boids world are as follows:
656656
local flockmates
657657

658658

659-
.. admonition:: **Figure 7**
659+
.. admonition:: **Figure 4.9**
660660
:class: legend
661661

662662
Boids are governed by a set of three local rules (separation, cohesion and
@@ -874,17 +874,17 @@ velocity and position:
874874
875875
We finally visualize the result using a custom oriented scatter plot.
876876

877-
.. admonition:: **Figure 6**
877+
.. admonition:: **Figure 4.10**
878878
:class: legend
879879

880880
Boids is an artificial life program, developed by Craig Reynolds in 1986,
881881
which simulates the flocking behaviour of birds.
882882

883883
.. raw:: html
884884

885-
<video width="100%" class="bordered" controls>
886-
<source src="data/boids.mp4" type="video/mp4">
887-
Your browser does not support the video tag. </video>
885+
<video width="100%" class="bordered" controls>
886+
<source src="data/boids.mp4" type="video/mp4">
887+
Your browser does not support the video tag. </video>
888888

889889

890890

05-problem-vectorization.rst

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ split in two distinct problems: to find a path between two nodes in a graph and
171171
to find the shortest path. We'll illustrate this through path finding in a
172172
maze. First task is thus to build a maze.
173173

174-
.. admonition:: **Figure 8**
174+
.. admonition:: **Figure 5.1**
175175
:class: legend
176176

177177
A hedge maze at Longleat stately home in England.
@@ -247,7 +247,7 @@ maze is easy to solve. With low density, the maze has more "big empty rooms".
247247
248248
Here is an animation showing the generation process.
249249

250-
.. admonition:: **Figure**
250+
.. admonition:: **Figure 5.2**
251251
:class: legend
252252

253253
Progressive maze building with complexity and density control.
@@ -333,7 +333,7 @@ illustrated below (reading from left to right, top to bottom). Once this is
333333
done, we can ascent the gradient from the starting node. You can check on the
334334
figure this leads to the shortest path.
335335

336-
.. admonition:: **Figure**
336+
.. admonition:: **Figure 5.3**
337337
:class: legend
338338

339339
Value iteration algorithm on a simple maze. Once entrance has been reached,
@@ -424,7 +424,7 @@ solution, reusing part of the game of life code:
424424
Once this is done, we can ascent the gradient to find the shortest path as
425425
illustrated on the figure below:
426426

427-
.. admonition:: **Figure 8**
427+
.. admonition:: **Figure 5.4**
428428
:class: legend
429429

430430
Path finding using the Bellman-Ford algorithm. Gradient colors indicate
@@ -455,7 +455,7 @@ Fluid Dynamics
455455

456456

457457

458-
.. admonition:: **Figure 9**
458+
.. admonition:: **Figure 5.5**
459459
:class: legend
460460

461461
Hydrodynamic flow at two different zoom levels, Neckar river, Heidelberg,
@@ -525,7 +525,7 @@ original paper as well as the explanation by `Philip Rideout
525525
using this technique.
526526

527527

528-
.. admonition:: **Figure 9**
528+
.. admonition:: **Figure 5.6**
529529
:class: legend
530530

531531
Smoke simulation using the stable fluids algorithm by Jos Stam. Right most
@@ -578,7 +578,7 @@ methods have been proposed to achieve such noise whose most simple is certainly
578578
the DART method.
579579

580580

581-
.. admonition:: **Figure 10**
581+
.. admonition:: **Figure 5.7**
582582
:class: legend
583583

584584
Detail of "The Starry Night", Vincent van Gogh, 1889. The detail has been
@@ -685,7 +685,7 @@ reader. Note that not only this method is fast, but it also offers a better
685685
quality (more samples) than the DART method even with a high `k`
686686
parameter.
687687

688-
.. admonition:: **Figure**
688+
.. admonition:: **Figure 5.8**
689689
:class: legend
690690

691691
Comparison of uniform, grid-jittered and Bridson sampling.

06-custom-vectorization.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,7 @@ Glumpy
268268
visualization library in Python whose goal is to make it easy to create fast,
269269
scalable, beautiful, interactive and dynamic visualizations.
270270

271-
.. admonition:: **Figure**
271+
.. admonition:: **Figure 6.1**
272272
:class: legend
273273

274274
Simulation of a spiral galaxy using the density wave theory.
@@ -279,7 +279,7 @@ scalable, beautiful, interactive and dynamic visualizations.
279279

280280
|
281281
282-
.. admonition:: **Figure**
282+
.. admonition:: **Figure 6.2**
283283
:class: legend
284284

285285
Tiger display using collections and 2 GL calls

book.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ correct it as soon as you tell me.
6767
.. ----------------------------------------------------------------------------
6868
.. include:: 01-preface.rst
6969
.. include:: 02-introduction.rst
70-
.. .. include:: 03-anatomy.rst
70+
.. include:: 03-anatomy.rst
7171
.. include:: 04-code-vectorization.rst
7272
.. include:: 05-problem-vectorization.rst
7373
.. include:: 06-custom-vectorization.rst

0 commit comments

Comments
 (0)