From 6c67908a3a5b42e5cc2cc686df7d3fbc1c6385a6 Mon Sep 17 00:00:00 2001 From: t-bltg Date: Wed, 9 Feb 2022 16:04:22 +0100 Subject: [PATCH] UnicodePlots: allow setting `width` / `height` --- src/backends/unicodeplots.jl | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/backends/unicodeplots.jl b/src/backends/unicodeplots.jl index b5b05332..8d37aa7a 100644 --- a/src/backends/unicodeplots.jl +++ b/src/backends/unicodeplots.jl @@ -17,6 +17,9 @@ const _canvas_map = ( # since we need to know about all the series at the very beginning function unicodeplots_rebuild(plt::Plot{UnicodePlotsBackend}) plt.o = UnicodePlots.Plot[] + + up_width = UnicodePlots.DEFAULT_WIDTH[] + up_height = UnicodePlots.DEFAULT_HEIGHT[] has_layout = prod(size(plt.layout)) > 1 for sp in plt.subplots @@ -51,8 +54,8 @@ function unicodeplots_rebuild(plt::Plot{UnicodePlotsBackend}) end # blank plots will not be shown - width = has_layout && isempty(series_list(sp)) ? 0 : UnicodePlots.DEFAULT_WIDTH[] - height = UnicodePlots.DEFAULT_HEIGHT[] + width = has_layout && isempty(series_list(sp)) ? 0 : get(sp_kw, :width, up_width) + height = get(sp_kw, :height, up_height) plot_3d = is3d(sp) blend = get(sp_kw, :blend, true)