Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit a88eb01

Browse files
committed
minor clean up
1 parent 57de892 commit a88eb01

File tree

137 files changed

+9497
-6029
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

137 files changed

+9497
-6029
lines changed

.github/workflows/Deploy.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ jobs:
4343
with:
4444
node-version: 18
4545
cache: npm # or pnpm / yarn
46-
cache-dependency-path: 'package.json' # this should be a package-lock.json file
46+
cache-dependency-path: 'package-lock.json' # this should be a package-lock.json file
4747
- name: Setup Pages
4848
uses: actions/configure-pages@v3
4949
- name: Install dependencies

docs/.vitepress/config.mts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ export default defineConfig({
5858
{ text: 'line_type', link: '/examples/2d/lines/line_type' },
5959
{ text: 'line_types', link: '/examples/2d/lines/line_types' },
6060
{ text: 'line_cb', link: '/examples/2d/lines/line_cb' },
61+
{ text: 'log scales', link: '/examples/2d/lines/log_scales' },
6162
{ text: 'dates', link: '/examples/2d/lines/dates' },
6263
{ text: 'dates_break2_axis', link: '/examples/2d/lines/dates_break2_axis' },
6364
{ text: 'dates_break3_axis', link: '/examples/2d/lines/dates_break3_axis' }

docs/examples/2d/contours/contour.md

Lines changed: 20 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,24 +2,30 @@
22

33

44
```julia
5-
using Gnuplot, Random
6-
Random.seed!(123)
7-
let
8-
x = y = -15:0.33:15
9-
fz(x,y) = sin.(sqrt.(x.^2 + y.^2))./sqrt.(x.^2+y.^2)
10-
fxy = [fz(x,y) for x in x, y in y]
11-
@gsp x y fxy "w l lc palette" "set view map"
12-
@gsp :- "set contour base;set key off" "set auto fix"
13-
@gsp :- "set cntrparam levels 15" "unset surface"
14-
@gsp :- xlab = "x" ylab = "y"
15-
end
5+
using Gnuplot
6+
empty!(Gnuplot.options.init)
7+
push!( Gnuplot.options.init, linetypes(:Set1_5, lw=1.5, ps=1.5))
8+
function saveas(file; sx=550, sy=350, fs=0.8, term="svg")
9+
Gnuplot.save(term="$(term) size $(sx),$(sy) fontscale $(fs)", "$(file).svg")
10+
end;
1611
```
1712

1813

19-
```
20-
"assets/contour001.svg"
14+
<a id='Contour-plot'></a>
15+
16+
## Contour plot
17+
18+
19+
```julia
20+
x = y = -15:0.33:15
21+
fz(x,y) = sin.(sqrt.(x.^2 + y.^2))./sqrt.(x.^2+y.^2)
22+
fxy = [fz(x,y) for x in x, y in y]
23+
@gsp x y fxy "w l lc palette" "set view map"
24+
@gsp :- "set contour base;set key off" "set auto fix"
25+
@gsp :- "set cntrparam levels 15" "unset surface"
26+
@gsp :- xlab = "x" ylab = "y"
2127
```
2228

2329

24-
![](assets/contour001.svg)
30+
![](contour001.svg)
2531

docs/examples/2d/contours/contour_egg.md

Lines changed: 23 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2,26 +2,33 @@
22

33

44
```julia
5-
using Gnuplot, Random
6-
Random.seed!(123)
7-
let
8-
x = -1:0.05:1
9-
y = -1.5:0.05:2
10-
egg(x,y) = x^2 + y^2/(1.4 + y/5)^2
11-
segg = [egg(x,y) for x in x, y in y]
12-
@gsp x y segg "w l lc palette" palette(:thermal; rev= true) "set view map"
13-
@gsp :- "set contour base;set key off" "set auto fix"
14-
@gsp :- "set cntrparam levels incremental 0,0.01,1" "unset surface"
15-
@gsp :- xrange = (-1.2,1.2) yrange = (-1.5,2) cbrange =(0,1)
16-
@gsp :- xlab = "x" ylab = "y" "set size ratio -1"
17-
end
5+
using Gnuplot
6+
empty!(Gnuplot.options.init)
7+
push!( Gnuplot.options.init, linetypes(:Set1_5, lw=1.5, ps=1.5))
8+
function saveas(file; sx=550, sy=350, fs=0.8, term="svg")
9+
Gnuplot.save(term="$(term) size $(sx),$(sy) fontscale $(fs)", "$(file).svg")
10+
end;
1811
```
1912

2013

21-
```
22-
"assets/contour002.svg"
14+
<a id='Contour-plot:-egg-shape'></a>
15+
16+
## Contour plot: egg shape
17+
18+
19+
```julia
20+
x = -1:0.05:1
21+
y = -1.5:0.05:2
22+
egg(x,y) = x^2 + y^2/(1.4 + y/5)^2
23+
segg = [egg(x,y) for x in x, y in y]
24+
@gsp x y segg "w l lc palette" palette(:thermal; rev= true) "set view map"
25+
@gsp :- "set contour base;set key off" "set auto fix"
26+
@gsp :- "set cntrparam levels incremental 0,0.01,1" "unset surface"
27+
@gsp :- xrange = (-1.2,1.2) yrange = (-1.5,2) cbrange =(0,1)
28+
@gsp :- xlab = "x" ylab = "y" "set size ratio -1"
29+
saveas("contour002");
2330
```
2431

2532

26-
![](assets/contour002.svg)
33+
![](contour002.svg)
2734

docs/examples/2d/filledcu/between.md

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,26 @@
33

44
```julia
55
using Gnuplot
6-
let
7-
x = LinRange(-10,10,200)
8-
@gp x sin.(x) sin.(x) .+ 1 "with filledcu lc '#56B4E9' fs transparent solid 0.3"
9-
@gp :- x cos.(x) 1 .+ cos.(x) "with filledcu lc 'red' fs transparent solid 0.5"
10-
end
6+
empty!(Gnuplot.options.init)
7+
push!( Gnuplot.options.init, linetypes(:Set1_5, lw=1.5, ps=1.5))
8+
function saveas(file; sx=550, sy=350, fs=0.8, term="svg")
9+
Gnuplot.save(term="$(term) size $(sx),$(sy) fontscale $(fs)", "$(file).svg")
10+
end;
1111
```
1212

1313

14-
```
15-
"assets/filled002.svg"
14+
<a id='Filled-Between-curves'></a>
15+
16+
## Filled Between curves
17+
18+
19+
```julia
20+
x = LinRange(-10,10,200)
21+
@gp x sin.(x) sin.(x) .+ 1 "with filledcu lc '#56B4E9' fs transparent solid 0.3"
22+
@gp :- x cos.(x) 1 .+ cos.(x) "with filledcu lc 'red' fs transparent solid 0.5"
23+
saveas("filled002");
1624
```
1725

1826

19-
![](assets/filled002.svg)
27+
![](filled002.svg)
2028

docs/examples/2d/filledcu/filled.md

Lines changed: 20 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,22 +3,30 @@
33

44
```julia
55
using Gnuplot
6-
let
7-
x = LinRange(-10,10,200)
8-
fg(x,μ,σ) = exp.(.-(x.-μ).^2 ./(2σ^2))./*√(2π))
9-
@gp x fg(x, 0.25, 1.5) "w filledcurves lc '#E69F00' t '0.25,1.5'"
10-
@gp :- "set style fill transparent solid 0.5 noborder"
11-
@gp :- "set key title 'μ,σ' box 3" xlab = "x" ylab = "P(x)"
12-
@gp :- x fg(x, 2, 1) "w filledcu lc rgb '#56B4E9' t '2,1' fs transparent solid 0.25"
13-
@gp :- x fg(x, -1, 2) "w filledcu lc '#009E73' t '-1,2' fs transparent solid 0.1"
14-
end
6+
empty!(Gnuplot.options.init)
7+
push!( Gnuplot.options.init, linetypes(:Set1_5, lw=1.5, ps=1.5))
8+
function saveas(file; sx=550, sy=350, fs=0.8, term="svg")
9+
Gnuplot.save(term="$(term) size $(sx),$(sy) fontscale $(fs)", "$(file).svg")
10+
end;
1511
```
1612

1713

18-
```
19-
"assets/filled001.svg"
14+
<a id='Filled-curves'></a>
15+
16+
## Filled curves
17+
18+
19+
```julia
20+
x = LinRange(-10,10,200)
21+
fg(x,μ,σ) = exp.(.-(x.-μ).^2 ./(2σ^2))./*√(2π))
22+
@gp x fg(x, 0.25, 1.5) "w filledcurves lc '#E69F00' t '0.25,1.5'"
23+
@gp :- "set style fill transparent solid 0.5 noborder"
24+
@gp :- "set key title 'μ,σ' box 3" xlab = "x" ylab = "P(x)"
25+
@gp :- x fg(x, 2, 1) "w filledcu lc rgb '#56B4E9' t '2,1' fs transparent solid 0.25"
26+
@gp :- x fg(x, -1, 2) "w filledcu lc '#009E73' t '-1,2' fs transparent solid 0.1"
27+
saveas("filled001");
2028
```
2129

2230

23-
![](assets/filled001.svg)
31+
![](filled001.svg)
2432

0 commit comments

Comments
 (0)