Skip to content

Commit

Permalink
minor refactor of frame
Browse files Browse the repository at this point in the history
  • Loading branch information
wspr committed Mar 16, 2024
1 parent c9c25b1 commit cecd5f3
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions ausankey/ausankey.py
Original file line number Diff line number Diff line change
Expand Up @@ -216,11 +216,21 @@ def sankey(
# frame on top/bottom edge
frame_color = frame_color or [0, 0, 0, 1]

y_frame_gap = (title_gap + frame_gap) * plot_height

col = frame_color if frame_top else [1, 1, 1, 0]
ax.plot([0, plot_width], min(voffset) + (plot_height) + (title_gap + frame_gap) * plot_height + [0, 0], color=col)
ax.plot(
[0, plot_width],
min(voffset) + (plot_height) + y_frame_gap + [0, 0],
color=col,
)

col = frame_color if frame_bot else [1, 1, 1, 0]
ax.plot([0, plot_width], min(voffset) - (title_gap + frame_gap) * plot_height + [0, 0], color=col)
ax.plot(
[0, plot_width],
min(voffset) - y_frame_gap + [0, 0],
color=col,
)

# complete plot
ax.axis("off")
Expand Down

0 comments on commit cecd5f3

Please sign in to comment.