Skip to content

Commit 67dd87d

Browse files
committed
figure explaining diffusion
1 parent 354ed88 commit 67dd87d

File tree

2 files changed

+19
-0
lines changed

2 files changed

+19
-0
lines changed

images/diffusion.pdf

9.72 KB
Binary file not shown.

images/src/diffusion.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
from pyx import canvas, color, deco, path, text, unit
2+
3+
text.set(text.LatexRunner)
4+
text.preamble(r'\usepackage{arev}\usepackage[T1]{fontenc}\usepackage{nicefrac}')
5+
unit.set(xscale=1.0, wscale=1.2)
6+
7+
c = canvas.canvas()
8+
r = 0.05
9+
for n in range(1, 5):
10+
c.stroke(path.circle(n, 0, r))
11+
c.stroke(path.circle(-n, 0, r))
12+
c.stroke(path.circle(0, 0, r), [deco.filled([color.grey(0)])])
13+
dx = 0.1
14+
dy = 0.3
15+
c.stroke(path.curve(dx, dx, dy, dy, 1-dy, dy, 1-dx, dx), [deco.earrow])
16+
c.text(0.5, dy+0.1, '+1', [text.halign.center])
17+
c.stroke(path.curve(-dx, dx, -dy, dy, -1+dy, dy, -1+dx, dx), [deco.earrow])
18+
c.text(-0.5, dy+0.1, '-1', [text.halign.center])
19+
c.writePDFfile()

0 commit comments

Comments
 (0)