Skip to content

Commit

Permalink
Add plot for EmpiricalTransioplane
Browse files Browse the repository at this point in the history
  • Loading branch information
juliohm committed Oct 30, 2024
1 parent 88b5d85 commit 51fcfd3
Showing 1 changed file with 44 additions and 0 deletions.
44 changes: 44 additions & 0 deletions ext/transioplot.jl
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,50 @@ function transioplot(
fig
end

function transioplot(
t::EmpiricalTransioplane;
# common transiogram options
levels=nothing,
# empirical transioplane options
colormap=:viridis
)
# polar angle
θs = t.θs

# polar radius
rs = t.rs

# transioplane values
hs = t.hs

# number of labels
L = size(first(hs), 1)

# retrieve labels
l = isnothing(levels) ? (1:L) : levels

fig = Makie.Figure()
for i in 1:L, j in 1:L
lᵢ, lⱼ = l[i], l[j]
ax = Makie.PolarAxis(fig[i, j], title="$lᵢ$lⱼ")

# values in matrix form
h = getindex.(hs, i, j)
H = reduce(hcat, h)

# hide hole at center
rs = [zero(eltype(rs)); rs]
H = [H[1:1, :]; H]

# transpose for plotting
H = transpose(H)

Makie.surface!(ax, θs, rs, H, colormap=colormap, shading=Makie.NoShading)
end

fig
end

# ------------
# THEORETICAL
# ------------
Expand Down

0 comments on commit 51fcfd3

Please sign in to comment.