Skip to content

Commit

Permalink
Merge pull request #20 from JoelTrent/dev
Browse files Browse the repository at this point in the history
Fix quick start plots not showing up
  • Loading branch information
JoelTrent committed Jun 5, 2023
2 parents fa45be3 + c3107a9 commit 136de8f
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 4 deletions.
1 change: 1 addition & 0 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ jobs:
- uses: julia-actions/julia-docdeploy@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GKSwstype: "100"
- run: |
julia --project=docs -e '
using Documenter: DocMeta, doctest
Expand Down
27 changes: 23 additions & 4 deletions docs/src/quick_start.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,28 +17,38 @@ using EllipseSampling, Plots
e=construct_ellipse(1.0, 0.5, 0.0, 2.0, 1.0)
points=generate_N_equally_spaced_points(9, e; start_point_shift=0.0)
scatter(points[1,:], points[2,:])
savefig("equalspacing1.svg"); nothing # hide
```

![](equalspacing1.svg)

Or alternatively:
```example quick_start
using EllipseSampling, Plots
points=generate_N_equally_spaced_points(9, 1.0, 0.5, 0.0, 2.0, 1.0; start_point_shift=0.0)
scatter(points[1,:], points[2,:])
savefig("equalspacing2.svg"); nothing # hide
```

![](equalspacing2.svg)

### Rotated Ellipses

If our ellipse has an anticlockwise rotation of ``\\frac{1}{3}\\pi`` radians or 60 degrees then we modify that argument to [`construct_ellipse`](@ref).
If instead our ellipse has an anticlockwise rotation of ``\\frac{\\pi}{3}`` radians or 60 degrees then we modify that argument to [`construct_ellipse`](@ref).

```example quick_start
using EllipseSampling, Plots
e=construct_ellipse(1.0, 0.5, pi/3.0, 2.0, 1.0)
points=generate_N_equally_spaced_points(9, e; start_point_shift=0.0)
scatter(points[1,:], points[2,:])
savefig("equalspacing3.svg"); nothing # hide
```


![](equalspacing3.svg)

## Clustered Points

To more easily see the clustering effect we will increase the number of points generated and decrease the y radius. Note, the closer in magnitude the major and minor axis radii are, the weaker the clustering effect.
Expand All @@ -50,8 +60,11 @@ using EllipseSampling, Plots
e=construct_ellipse(1.0, 0.1, 0.0, 2.0, 1.0)
points=generate_N_clustered_points(30, e; start_point_shift=0.0, sqrt_distortion=0.0)
scatter(points[1,:], points[2,:])
savefig("clustering1.svg"); nothing # hide
```

![](clustering1.svg)

The clustering effect becomes weaker when we increase the parameter `sqrt_distortion` towards 1.0:

```example quick_start
Expand All @@ -63,22 +76,26 @@ for sqrt_distortion in 0.0:0.2:1.0
points=generate_N_clustered_points(10, e; start_point_shift=0.0, sqrt_distortion=sqrt_distortion)
scatter!(points[1,:], points[2,:], label=string("sqrt_distortion=",sqrt_distortion))
end
savefig("clustering2.svg"); nothing # hide
```

![](clustering2.svg)

The clustering effect is completely gone if our ellipse is a circle:

```example quick_start
using EllipseSampling, Plots
plt=plot()
plot()
e=construct_ellipse(1.0, 1.0, 0.0, 2.0, 1.0)
for sqrt_distortion in 0.0:0.5:1.0
points=generate_N_clustered_points(10, e; start_point_shift=0.0, sqrt_distortion=sqrt_distortion)
scatter!(plt, points[1,:], points[2,:], label=string("sqrt_distortion=",sqrt_distortion),
scatter!(points[1,:], points[2,:], label=string("sqrt_distortion=",sqrt_distortion),
markersize=7-sqrt_distortion*3, markeralpha=0.5)
end
plt
savefig("clustering3.svg"); nothing # hide
```
![](clustering3.svg)

## Custom Sampling Method

Expand All @@ -95,5 +112,7 @@ points = generate_perimeter_point.(samples, Ref(e))
points = reduce(hcat, points)
scatter(points[1,:], points[2,:])
savefig("customsampling.svg"); nothing # hide
```

![](customsampling.svg)

0 comments on commit 136de8f

Please sign in to comment.