From bee980c5bcf44b6fe21b397ac029c25228952705 Mon Sep 17 00:00:00 2001 From: Alberto Mengali Date: Wed, 22 Sep 2021 12:55:54 +0200 Subject: [PATCH] Fix 3d plot concatenation --- src/subplots.jl | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/subplots.jl b/src/subplots.jl index 2728112..66591a1 100644 --- a/src/subplots.jl +++ b/src/subplots.jl @@ -99,10 +99,14 @@ function _cat(rows::Tuple{Vararg{Int}}, ps::Plot...) layout["yaxis$ix"] = merge(copied_plots[ix].layout["yaxis"], layout["yaxis$ix"]) if _is3d(copied_plots[ix]) - # need to move (x|y)axis$ix into scene$ix here + # need to remove (x|y)axis$ix and move their domains into scene$ix here + xaxis = pop!(layout, "xaxis$(ix)") + yaxis = pop!(layout, "yaxis$(ix)") layout["scene$ix"] = attr( - xaxis=pop!(layout, "xaxis$(ix)"), - yaxis=pop!(layout, "yaxis$(ix)") + domain = attr( + x = xaxis[:domain], + y = yaxis[:domain] + ) ) for trace in copied_plots[ix].data trace["scene"] = "scene$ix" @@ -111,7 +115,7 @@ function _cat(rows::Tuple{Vararg{Int}}, ps::Plot...) for trace in copied_plots[ix].data trace["xaxis"] = "x$ix" trace["yaxis"] = "y$ix" -end + end end end