-
-
Notifications
You must be signed in to change notification settings - Fork 80
/
Copy pathIntervalSetsExt.jl
38 lines (32 loc) · 964 Bytes
/
IntervalSetsExt.jl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
module IntervalSetsExt
import UnicodePlots
import IntervalSets
function interval_range(x::IntervalSets.AbstractInterval, length, step)
if length ≡ nothing && step ≡ nothing
length = UnicodePlots.DEFAULT_WIDTH[]
end
range(x; length, step)
end
UnicodePlots.lineplot(
x::IntervalSets.AbstractInterval,
f::Function;
length = nothing,
step = nothing,
kw...,
) = UnicodePlots.lineplot(interval_range(x, length, step), f; kw...)
UnicodePlots.lineplot!(
plot::UnicodePlots.Plot{<:UnicodePlots.Canvas},
x::IntervalSets.AbstractInterval,
f::Function;
length = nothing,
step = nothing,
kw...,
) = UnicodePlots.lineplot!(plot, interval_range(x, length, step), f; kw...)
UnicodePlots.lineplot(
x::IntervalSets.AbstractInterval,
F::AbstractVector{<:Function};
length = nothing,
step = nothing,
kw...,
) = UnicodePlots.lineplot(interval_range(x, length, step), F; kw...)
end # module