Skip to content

Commit 502fdfd

Browse files
committed
improve code readibility
1 parent c27f88a commit 502fdfd

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

Diff for: packages/python/plotly/plotly/express/_imshow.py

+3-5
Original file line numberDiff line numberDiff line change
@@ -522,14 +522,13 @@ def imshow(
522522
slice_label = "slice" if labels.get("facet") is None else labels["facet"]
523523
col_labels = ["%s = %d" % (slice_label, i) for i in facet_slices]
524524
fig = init_figure(args, "xy", [], nrows, ncols, col_labels, [])
525-
layout_patch = dict()
526525
for attr_name in ["height", "width"]:
527526
if args[attr_name]:
528-
layout_patch[attr_name] = args[attr_name]
527+
layout[attr_name] = args[attr_name]
529528
if args["title"]:
530-
layout_patch["title_text"] = args["title"]
529+
layout["title_text"] = args["title"]
531530
elif args["template"].layout.margin.t is None:
532-
layout_patch["margin"] = {"t": 60}
531+
layout["margin"] = {"t": 60}
533532

534533
frame_list = []
535534
for index, trace in enumerate(traces):
@@ -547,7 +546,6 @@ def imshow(
547546
if animation_frame:
548547
fig.frames = frame_list
549548
fig.update_layout(layout)
550-
fig.update_layout(layout_patch)
551549
# Hover name, z or color
552550
if binary_string and rescale_image and not np.all(img == img_rescaled):
553551
# we rescaled the image, hence z is not displayed in hover since it does

0 commit comments

Comments
 (0)