Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding arbitrary legend_columns for python-backends #4678

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Catching undefined negative legend_columns for gr
  • Loading branch information
briederer committed Mar 3, 2023
commit 0be3c6fdf1721aea226467dc3bf42ca165813c06
5 changes: 2 additions & 3 deletions src/backends/gr.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1222,14 +1222,13 @@ function gr_get_legend_geometry(vp, sp)
elseif legend_column > nseries && nseries != 0 # catch plot_title here
@warn "n° of legend_column=$legend_column is larger than n° of series=$nseries"
(1 + has_title, nseries)
elseif legend_column == 0
@warn "n° of legend_column=$legend_column. Assuming vertical layout."
elseif legend_column == 0 || legend_column < -1
@warn "n° of legend_column=$legend_column has undefined behaviour. Assuming vertical layout."
vertical = true
(has_title + nseries, 1)
else
(ceil(Int64, nseries / legend_column) + has_title, legend_column)
end
#println(column_layout)

base_factor = width(vp) / 45 # determines legend box base width (arbitrarily based on `width`)

Expand Down