Skip to content

Commit c6c041c

Browse files
authored
Merge pull request #312 from FourierFlows/ncc/simplify-aliasing-example
2 parents 993f09d + 86a65e1 commit c6c041c

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

docs/src/aliasing.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,14 @@ using FourierFlows, Plots
2626
2727
nx, Lx = 10, 2π
2828
grid = OneDGrid(nx, Lx)
29+
x = grid.x
2930
3031
f1(x) = cos(4x)
3132
f2(x) = cos(6x)
3233
33-
p = plot(grid.x, f1.(grid.x), lw=0, marker=:circle, c=:red, ms=8, ylims=(-1.6, 1.6), label="cos(4x)")
34+
p = plot(x, f1.(x), lw=0, marker=:circle, c=:red, ms=8, ylims=(-1.6, 1.6), label="cos(4x)")
3435
plot!(p, f1, lw=3, alpha=0.2, c=:red, xlims=(-Lx/2, Lx/2), label="")
35-
plot!(p, grid.x, f2.(grid.x), lw=0, marker=:star5, ms=8.5, color=:blue, alpha=0.8, label="cos(6x)")
36+
plot!(p, x, f2.(x), lw=0, marker=:star5, ms=8.5, color=:blue, alpha=0.8, label="cos(6x)")
3637
plot!(p, f2, lw=3, alpha=0.2, c=:blue, xlims=(-Lx/2, Lx/2), label="")
3738
3839
plot(p, xlabel="x", xlims=(-3.3, 3.3))

0 commit comments

Comments
 (0)