diff --git a/src/plot.jl b/src/plot.jl index 5f8f69d9..2b7ab389 100644 --- a/src/plot.jl +++ b/src/plot.jl @@ -102,8 +102,13 @@ function plot(plt1::Plot, plts_tail::Plot...; kw...) end end - # create the layout and initialize the subplots + # create the layout plt.layout, plt.subplots, plt.spmap = build_layout(layout, num_sp, copy(plts)) + + # do we need to link any axes together? + link_axes!(plt.layout, plt[:link]) + + # initialize the subplots cmdidx = 1 for (idx, sp) in enumerate(plt.subplots) _initialize_subplot(plt, sp) @@ -127,9 +132,6 @@ function plot(plt1::Plot, plts_tail::Plot...; kw...) _update_subplot_args(plt, sp, d, idx, false) end - # do we need to link any axes together? - link_axes!(plt.layout, plt[:link]) - # finish up current(plt) _do_plot_show(plt, get(d, :show, default(:show)))