From 311831ca4eb612bc2db0cc88249aa83f07292e3f Mon Sep 17 00:00:00 2001 From: t-bltg Date: Sat, 22 Jan 2022 18:26:13 +0100 Subject: [PATCH] UnicodePlots: do not show blank plots (on layouts) (#4058) --- src/backends/unicodeplots.jl | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/backends/unicodeplots.jl b/src/backends/unicodeplots.jl index 2994acb4c..b1f4ee38b 100644 --- a/src/backends/unicodeplots.jl +++ b/src/backends/unicodeplots.jl @@ -19,6 +19,7 @@ const _canvas_map = ( function unicodeplots_rebuild(plt::Plot{UnicodePlotsBackend}) plt.o = UnicodePlots.Plot[] + has_layout = prod(size(plt.layout)) > 1 for sp in plt.subplots xaxis = sp[:xaxis] yaxis = sp[:yaxis] @@ -47,7 +48,9 @@ function unicodeplots_rebuild(plt::Plot{UnicodePlotsBackend}) up_b end - width, height = UnicodePlots.DEFAULT_WIDTH[], UnicodePlots.DEFAULT_HEIGHT[] + # blank plots will not be shown + width = has_layout && isempty(series_list(sp)) ? 0 : UnicodePlots.DEFAULT_WIDTH[] + height = UnicodePlots.DEFAULT_HEIGHT[] grid = xaxis[:grid] && yaxis[:grid] quiver = contour = false