Skip to content

Commit

Permalink
Modified to avoid KeyError
Browse files Browse the repository at this point in the history
  • Loading branch information
ponnhide committed Apr 20, 2022
1 parent bd88e5b commit 60fd483
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions patchworklib/patchworklib.py
Original file line number Diff line number Diff line change
Expand Up @@ -291,8 +291,10 @@ def draw_labels(bricks, gcp):
def draw_legend(bricks, gori, gcp, figsize):
get_property = gcp.theme.themeables.property
legend_box = gcp.guides.build(gcp)
with suppress(KeyError):
try:
spacing = get_property('legend_box_spacing')
except KeyError:
spacing = 0.1
position = gori.guides.position
if position == 'right':
loc = 6
Expand Down Expand Up @@ -347,8 +349,12 @@ def draw_title(bricks, gcp, figsize):
pad = 3
else:
pad = margin.get_as('b', 'in') / 0.09,
bricks._case.set_title(title, pad=pad[0], fontsize=fontsize)


if type(pad) in (list, tuple):
bricks._case.set_title(title, pad=pad[0], fontsize=fontsize)
else:
bricks._case.set_title(title, pad=pad, fontsize=fontsize)

#save_original_position
global _axes_dict
position_dict = {}
Expand Down

0 comments on commit 60fd483

Please sign in to comment.