From 10e4219d66f08faecddfe2fcea144c28fe1237fb Mon Sep 17 00:00:00 2001 From: gecko984 Date: Tue, 25 Feb 2020 11:47:54 +0300 Subject: [PATCH] add alternating grey background --- setup.py | 2 +- supervenn/_plots.py | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 20e7b59..835a883 100644 --- a/setup.py +++ b/setup.py @@ -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(), diff --git a/supervenn/_plots.py b/supervenn/_plots.py index 7a6114d..69c4cda 100644 --- a/supervenn/_plots.py +++ b/supervenn/_plots.py @@ -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