Skip to content
Snippets Groups Projects
Commit cc88548f authored by Luca Lenz's avatar Luca Lenz
Browse files

finally fixed dims argument in chainplot

parent 0f9dddf9
No related branches found
No related tags found
No related merge requests found
......@@ -43,7 +43,7 @@ end
function chainplot(x::AbstractVector{<:AbstractVector{<:Real}}; dims=length(x), size=(1024, 512 * dims), kwargs...)
fig = Figure(; size)
axs = [ [Axis(fig[i,1]), Axis(fig[i,2])] for i=1:dims ]
plt = chainplot!(axs, x; kwargs...)
plt = chainplot!(axs, x; dims, kwargs...)
return fig, axs, plt
end
......@@ -76,17 +76,17 @@ end
function chainplot(x::Union{AbstractMatrix{<:Real}, AbstractVector{<:AbstractVector{<:Real}}}, logp_x::AbstractVector{<:Real}; dims=length(x), size=(1024, 512 * (1+dims)), kwargs...)
fig = Figure(; size)
axs = [[Axis(fig[i,1]), Axis(fig[i,2])] for i=1:dims+1]
plts = chainplot!(axs, x, logp_x; kwargs...)
plts = chainplot!(axs, x, logp_x; dims, kwargs...)
return fig, axs, plts
end
## matrix of states
function chainplot!(axs::AbstractVector{<:AbstractVector{<:Makie.AbstractAxis}}, x::AbstractMatrix{<:Real}; dims=size(x,1), kwargs...)
return chainplot!(axs, [x[i,:] for i=1:dims]; kwargs...)
return chainplot!(axs, [x[i,:] for i=1:dims]; dims, kwargs...)
end
function chainplot!(axs::AbstractVector{<:AbstractVector{<:Makie.AbstractAxis}}, x::AbstractMatrix{<:Real}, logp_x::AbstractVector{<:Real}; dims=size(x,1), kwargs...)
return chainplot!(axs, [x[i,:] for i=1:dims], logp_x; kwargs...)
return chainplot!(axs, [x[i,:] for i=1:dims], logp_x; dims, kwargs...)
end
function chainplot(x::AbstractMatrix{<:Real}; dims=size(x,1), kwargs...)
return chainplot([x[i,:] for i=1:dims]; dims, kwargs...)
......
......@@ -29,9 +29,9 @@ chainplot!(ax, x2, logp_x2)
display(fig)
fig,ax,plt = chainplot(y1)
chainplot!(ax, y2)
chainplot!(ax, y2, dims=3)
display(fig)
fig,ax,plt = chainplot(y1, logp_y1)
chainplot!(ax, y2, logp_y2, dims=3)
fig,ax,plt = chainplot(y1, logp_y1, dims=2)
chainplot!(ax, y2, logp_y2, dims=2)
display(fig)
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment