Skip to content

Commit

Permalink
add alternating grey background
Browse files Browse the repository at this point in the history
  • Loading branch information
gecko984 committed Feb 25, 2020
1 parent c27f763 commit 10e4219
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
name='supervenn',
license='MIT',
description='supervenn is a tool for visualization of relations of many sets using matplotlib',
version='0.1.8',
version='0.1.9',
long_description='See https://github.com/gecko984/supervenn/blob/master/README.md',
url='https://github.com/gecko984/supervenn',
packages=setuptools.find_packages(),
Expand Down
5 changes: 5 additions & 0 deletions supervenn/_plots.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,11 @@ def plot_binary_array(arr, ax=None, col_widths=None, row_heights=None, min_width

bar_y = grid_y + 0.5 * row_height if bar_align == 'center' else grid_y

# alternating background
if row_index % 2:
plt.barh(y=bar_y, left=0, width=sum(col_widths), height=bar_height * row_height, align=bar_align,
color='grey', alpha=0.15)

for col_index, (is_filled, grid_x, col_width) in enumerate(zip(row, grid_xs, col_widths)):
if is_filled:
color_index = row_index if color_by == 'row' else col_index
Expand Down

0 comments on commit 10e4219

Please sign in to comment.