This repository was archived by the owner on Nov 6, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +36
-0
lines changed Expand file tree Collapse file tree 3 files changed +36
-0
lines changed Original file line number Diff line number Diff line change @@ -6,11 +6,13 @@ version = "0.1.0"
66[deps ]
77Distributions = " 31c24e10-a181-5473-b8eb-7969acd0382f"
88GeoStatsBase = " 323cb8eb-fbf6-51c0-afd0-f8fba70507b2"
9+ RecipesBase = " 3cdcf5f2-1ef4-517c-9805-6587b60abb01"
910StaticArrays = " 90137ffa-7385-5640-81b9-e52037218182"
1011
1112[compat ]
1213Distributions = " 0.21"
1314GeoStatsBase = " 0.7"
15+ RecipesBase = " 0.7"
1416StaticArrays = " 0.12"
1517julia = " 1"
1618
Original file line number Diff line number Diff line change @@ -8,12 +8,16 @@ using GeoStatsBase
88
99using Distributions: Uniform, Poisson, product_distribution
1010using StaticArrays: SVector, MVector
11+ using RecipesBase
1112
1213import GeoStatsBase: npoints, coordinates, coordinates!
1314
1415include (" pattern.jl" )
1516include (" processes.jl" )
1617
18+ # plot recipes
19+ include (" plotrecipes/pattern.jl" )
20+
1721export
1822 # point pattern
1923 PointPattern,
Original file line number Diff line number Diff line change 1+ # ------------------------------------------------------------------
2+ # Licensed under the ISC License. See LICENSE in the project root.
3+ # ------------------------------------------------------------------
4+
5+ @recipe function f (pp:: PointPattern{T,N} ) where {N,T}
6+ X = coordinates (pp)
7+
8+ seriestype --> :scatter
9+ markersize --> 2
10+ color --> :black
11+ legend --> false
12+
13+ if N == 1
14+ @series begin
15+ X[1 ,:], fill (0 , npoints (pp))
16+ end
17+ elseif N == 2
18+ aspect_ratio --> :equal
19+ @series begin
20+ X[1 ,:], X[2 ,:]
21+ end
22+ elseif N == 3
23+ aspect_ratio --> :equal
24+ @series begin
25+ X[1 ,:], X[2 ,:], X[3 ,:]
26+ end
27+ else
28+ @error " cannot plot in more than 3 dimensions"
29+ end
30+ end
You can’t perform that action at this time.
0 commit comments