From 3340642d430e625174cbeebde26fff920f7a43f0 Mon Sep 17 00:00:00 2001 From: t-bltg <13423344+t-bltg@users.noreply.github.com> Date: Sat, 3 Jul 2021 17:07:51 +0200 Subject: [PATCH] Update bbs/plot_title (#3604) * add the plot_title * update plot_title for multiple subplots, fix GR warning Co-authored-by: Simon Christ Co-authored-by: t-bltg --- src/pipeline.jl | 8 ++++---- src/plot.jl | 1 + 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/pipeline.jl b/src/pipeline.jl index 63bed9ef..77493eb3 100644 --- a/src/pipeline.jl +++ b/src/pipeline.jl @@ -286,14 +286,14 @@ function _add_plot_title!(plt) plot_title = plt[:plot_title] if plot_title != "" the_layout = plt.layout - plt.layout = grid(2,1, heights = [0.0,1.0]) - plt.layout.grid[2,1] = the_layout - subplot = Subplot(backend(), parent = plt.layout[1,1]) + plt.layout = grid(2, 1, heights=(.01, .99)) + plt.layout.grid[2, 1] = the_layout + subplot = Subplot(backend(), parent = plt.layout[1, 1]) subplot.plt = plt subplot[:title] = plot_title subplot[:subplot_index] = last(plt.subplots)[:subplot_index] + 1 subplot[:framestyle] = :none - plt.layout.grid[1,1] = subplot + plt.layout.grid[1, 1] = subplot push!(plt.subplots, subplot) end return nothing diff --git a/src/plot.jl b/src/plot.jl index fb802774..ee3fb7e9 100644 --- a/src/plot.jl +++ b/src/plot.jl @@ -159,6 +159,7 @@ function plot!(plt1::Plot, plts_tail::Plot...; kw...) cmdidx += 1 end end + _add_plot_title!(plt) # first apply any args for the subplots for (idx,sp) in enumerate(plt.subplots)