Skip to content

Commit

Permalink
fix xaxis/yaxis rendering, add keyword axes in PlotLayout
Browse files Browse the repository at this point in the history
  • Loading branch information
Helmut Hänsel committed Mar 5, 2024
1 parent 3c7e03c commit f1417f5
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions src/Layouts.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1089,6 +1089,7 @@ Base.@kwdef mutable struct PlotLayout
title::Union{PlotLayoutTitle,Nothing} = nothing
xaxis::Union{Vector{PlotLayoutAxis},Nothing} = nothing
yaxis::Union{Vector{PlotLayoutAxis},Nothing} = nothing
axes::Union{Vector{PlotLayoutAxis},Nothing} = nothing

showlegend::Union{Bool,Nothing} = nothing # true
legend::Union{PlotLayoutLegend,Nothing} = nothing
Expand Down Expand Up @@ -1231,13 +1232,21 @@ function Base.Dict(pl::PlotLayout, fieldname::Union{Symbol,Nothing} = nothing)


if pl.xaxis !== nothing
for d in Dict.(pl.xaxis)
merge!(layout, d)
for x in pl.xaxis
x.xy = "x"
merge!(layout, Dict(x))
end
end

if pl.yaxis !== nothing
for d in Dict.(pl.yaxis)
for y in pl.yaxis
y.xy = "y"
merge!(layout, Dict(y))
end
end

if pl.axes !== nothing
for d in Dict.(pl.axes)
merge!(layout, d)
end
end
Expand Down

0 comments on commit f1417f5

Please sign in to comment.