Skip to content

Commit

Permalink
UnicodePlots: do not show blank plots (on layouts) (#4058)
Browse files Browse the repository at this point in the history
  • Loading branch information
t-bltg committed Jan 22, 2022
1 parent ab698da commit 311831c
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/backends/unicodeplots.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 311831c

Please sign in to comment.