Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 502fdfd

Browse filesBrowse files
committed
improve code readibility
1 parent c27f88a commit 502fdfd
Copy full SHA for 502fdfd

File tree

Expand file treeCollapse file tree

1 file changed

+3
-5
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+3
-5
lines changed

‎packages/python/plotly/plotly/express/_imshow.py

Copy file name to clipboardExpand all lines: packages/python/plotly/plotly/express/_imshow.py
+3-5Lines changed: 3 additions & 5 deletions
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 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.