Skip to content

Commit 40092de

Browse files
authored
Merge pull request #295 from scverse/fix/dotplot-vcenter-zero
Fix dotplot vcenter=0 ignored due to falsy check
2 parents 539b787 + 6901cd8 commit 40092de

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

src/decoupler/pl/_dotplot.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ def dotplot(
102102
# Plot
103103
ns = (s_vals * scale * plt.rcParams["lines.markersize"]) ** 2
104104
bp.ax.grid(axis="x")
105-
if vcenter:
105+
if vcenter is not None:
106106
norm = TwoSlopeNorm(vmin=None, vcenter=vcenter, vmax=None)
107107
else:
108108
norm = None

tests/pl/test_dotplot.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ def df():
2020
return df
2121

2222

23-
@pytest.mark.parametrize("vcenter", [None, 3])
23+
@pytest.mark.parametrize("vcenter", [None, 0, 3])
2424
def test_dotplot(
2525
df,
2626
vcenter,

0 commit comments

Comments
 (0)