Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit cf99af9

Browse files
slightly more robust
1 parent 62b3905 commit cf99af9

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

packages/python/plotly/plotly/figure_factory/_annotated_heatmap.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -196,14 +196,14 @@ def __init__(
196196
self.zmin = min([v for row in self.z for v in row])
197197
self.zmax = max([v for row in self.z for v in row])
198198

199-
if "zmin" in kwargs:
199+
if kwargs.get("zmin", None) is not None:
200200
self.zmin = kwargs["zmin"]
201-
if "zmax" in kwargs:
201+
if kwargs.get("zmax", None) is not None:
202202
self.zmax = kwargs["zmax"]
203203

204204
self.zmid = (self.zmax + self.zmin) / 2
205205

206-
if "zmid" in kwargs:
206+
if kwargs.get("zmid", None) is not None:
207207
self.zmin = kwargs["zmid"]
208208

209209
def get_text_color(self):

0 commit comments

Comments
 (0)