Skip to content

Commit fc793ba

Browse files
committed
Simplify documentation plots
1 parent 5dcfb71 commit fc793ba

File tree

2 files changed

+11
-4
lines changed

2 files changed

+11
-4
lines changed

docs/plots/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# This folder contains naive, basic and dirty code used to generate illustrations for the documentation of [PartialRejectionSampling.jl](https://github.com/guilgautier/PartialRejectionSampling.jl).

docs/plots/pedagogy_spatial.jl

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,6 @@ using Distributions
33

44
using Plots
55

6-
using LazySets
7-
const LS = LazySets
8-
96
# Pedagogy
107
function pedagogy_generate_sample_prs(
118
pp::PRS.HardCorePointProcess{T};
@@ -73,7 +70,7 @@ function pedagogy_plot!(
7370
)
7471
for x in (points isa Matrix ? eachcol(points) : points)
7572
if radius > 0
76-
Plots.plot!(p, LS.Ball2(vec(x), radius), color=color, grid=false)
73+
plot_disk!(p, x, radius, color)
7774
end
7875
if show_center
7976
Plots.scatter!(p, [x[1]], [x[2]], markersize=2, color=color, grid=false)
@@ -107,6 +104,15 @@ function pedagogy_plot(
107104
return p
108105
end
109106

107+
function plot_disk!(p, center, radius, color=:white)
108+
θ = LinRange(0, 2π, 15)
109+
x, y = center[1] .+ radius .* cos.(θ), center[2] .+ radius .* sin.(θ)
110+
111+
Plots.plot!(p, x, y, seriestype=[:shape], c=color, linewidth=0.5, legend=false, fillapha=0.2)
112+
113+
return p
114+
end
115+
110116
function plot(
111117
pp::PRS.AbstractSpatialPointProcess,
112118
points;

0 commit comments

Comments
 (0)