Skip to content

Commit e37aacf

Browse files
committed
Added General Overview page
1 parent 467958a commit e37aacf

File tree

3 files changed

+149
-5
lines changed

3 files changed

+149
-5
lines changed

Diff for: docs/make.jl

+1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ makedocs(
77
"Home" => "index.md",
88
"Usage" => [
99
"usage/tutorial.md",
10+
"usage/general.md",
1011
"usage/cvd.md",
1112
],
1213
"Library" => [

Diff for: docs/src/usage/general.md

+144
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,144 @@
1+
# General Overview
2+
3+
!!! note
4+
`DomainColoring.jl` provides plots on top of the
5+
[Makie](https://makie.org) framework, thus a user will have to
6+
additionally install and load a Makie backend such as `CiaroMakie`
7+
or `GLMakie`.
8+
9+
## Common options
10+
11+
All plotting functions require a function ``\mathbb{C} \to \mathbb{C}``
12+
as first argument and accept optionally axis limits as a second.
13+
14+
If no limits are provided by default unit length is taken in all four
15+
directions. If a list of two numbers is provided the first is used as
16+
both limit in the real direction and the second in the imaginary
17+
direction. A list of four elements are interpreted as
18+
``({\rm Re}_{\rm min}, {\rm Re}_{\rm max}, {\rm Im}_{\rm min},
19+
{\rm Im}_{\rm max})``.
20+
21+
Finally all plots have a keyword argument `pixels` by which one can
22+
specify the number of samples in respectively the real and imaginary
23+
direction. If only one number is provided it is used for both.
24+
25+
The remainder of this page gives a quick overview of the main plotting
26+
functions of `DomainColoring.jl`.
27+
28+
## The [`domaincolor`](@ref) function
29+
30+
!!! note
31+
The phase output of [`domaincolor`](@ref) is generally not suited
32+
for those with color vision deficiency, refer to [Plotting for Color
33+
Vision Deficiency](@ref) instead.
34+
35+
By default [`domaincolor`](@ref) produces a phase plot such as the
36+
following.
37+
```@example
38+
using CairoMakie, DomainColoring # hide
39+
domaincolor(sinc, (3, 1.5))
40+
save("dcsincphase.png", current_figure()) # hide
41+
nothing # hide
42+
```
43+
![](dcsincphase.png)
44+
45+
One can additionally superimpose contour lines of the magnitude as
46+
sweeps of increasing lightness by setting `abs = true`. Where this
47+
increase of lightness is taken proportional to the fractional part of
48+
$|f(z)|$.
49+
```@example
50+
using CairoMakie, DomainColoring # hide
51+
domaincolor(sinc, (3, 1.5), abs=true)
52+
save("dcsincabs.png", current_figure()) # hide
53+
nothing # hide
54+
```
55+
![](dcsincabs.png)
56+
57+
Alternatively one can take it proportional to the fractional part of
58+
``\log|f(z)|``, by setting `logabs = true`. When both `abs` and `logabs`
59+
are set to true, `logabs` takes precedence.
60+
```@example
61+
using CairoMakie, DomainColoring # hide
62+
domaincolor(sinc, (3, 1.5), logabs=true)
63+
save("dcsinclogabs.png", current_figure()) # hide
64+
nothing # hide
65+
```
66+
![](dcsinclogabs.png)
67+
68+
Finally, one can also add a dark grid where the imaginary or real part
69+
of ``f(z)`` is integer by setting `grid = true`.
70+
```@example
71+
using CairoMakie, DomainColoring # hide
72+
domaincolor(sinc, (3, 1.5), grid=true)
73+
save("dcsincgrid.png", current_figure()) # hide
74+
nothing # hide
75+
```
76+
![](dcsincgrid.png)
77+
78+
Of course these options can be combined, the common combination of
79+
`abs = true` and `grid = true` even has an abbreviation `all = true`.
80+
```@example
81+
using CairoMakie, DomainColoring # hide
82+
domaincolor(sinc, (3, 1.5), all=true)
83+
save("dcsincall.png", current_figure()) # hide
84+
nothing # hide
85+
```
86+
![](dcsincall.png)
87+
88+
## The [`checkerplot`](@ref) function
89+
90+
A checker plot shows limited information and is useful to detect
91+
patterns in certain contexts. By default a checker board pattern is used
92+
with five stripes for an unit increase in either direction. A
93+
checkerplot of the identity function makes this clearer.
94+
```@example
95+
using CairoMakie, DomainColoring # hide
96+
checkerplot(z -> z)
97+
save("cprect.png", current_figure()) # hide
98+
nothing # hide
99+
```
100+
![](cprect.png)
101+
102+
You can limit the stripes to only show increase in the real or imaginary
103+
part by setting `real = true` or `imag = true`, respectively. Again the
104+
previous example.
105+
```@example
106+
using CairoMakie, DomainColoring # hide
107+
checkerplot(z -> z, real=true)
108+
save("cpreal.png", current_figure()) # hide
109+
nothing # hide
110+
```
111+
![](cpreal.png)
112+
113+
Setting `real = true` and `imag = true` can be abbreviated to
114+
`rect = true`, which is identical to the default behaviour.
115+
116+
Alternatively one can also display a polar grid by setting
117+
`polar = true`, giving 5 band per unit increase of ``\log|f(z)|`` and 32
118+
bands per ``2\pi`` increase of ``\arg(f(z))``.
119+
```@example
120+
using CairoMakie, DomainColoring # hide
121+
checkerplot(z -> z, polar=true)
122+
save("cppolar.png", current_figure()) # hide
123+
nothing # hide
124+
```
125+
![](cppolar.png)
126+
127+
As with `rect = true`, `polar = true` is an abbreviation for
128+
`abs = true` and `angle = true`, showing magnitude and phase
129+
respectively. It is worthwhile to illustrate both, giving for magnitude:
130+
```@example
131+
using CairoMakie, DomainColoring # hide
132+
checkerplot(z -> z, abs=true)
133+
save("cpabs.png", current_figure()) # hide
134+
nothing # hide
135+
```
136+
![](cpabs.png)
137+
and for phase:
138+
```@example
139+
using CairoMakie, DomainColoring # hide
140+
checkerplot(z -> z, angle=true)
141+
save("cpangle.png", current_figure()) # hide
142+
nothing # hide
143+
```
144+
![](cpangle.png)

Diff for: docs/src/usage/tutorial.md

+4-5
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22

33
!!! note
44
If you're experienced with Julia and phase plots, this document
5-
might be fairly basic. Continue to the [Public Interface](@ref)
6-
documentation instead.
5+
might be fairly basic. Continue to the [General Overview](@ref)
6+
instead.
77

88
## Installation, loading and Makie
99

@@ -127,9 +127,8 @@ As a final example, let us show off a few more capabilities of the
127127

128128
This is a plot of ``f(z) = z^3i - 1`` with level curves of the logarithm
129129
of the magnitude and an integer grid. You can continue by reading the
130-
[Public Interface](@ref) documentation to learn more about these and
131-
other additional options, and the other provided plotting function
132-
[`checkerplot`](@ref).
130+
[General Overview](@ref) to learn more about these and other additional
131+
options, and the other provided plotting function [`checkerplot`](@ref).
133132

134133
```@example
135134
using CairoMakie, DomainColoring # hide

0 commit comments

Comments
 (0)