Skip to content
This repository was archived by the owner on Jun 3, 2024. It is now read-only.

Commit 326bd1c

Browse files
🙈 fixing shared colorscales
1 parent 1fa628a commit 326bd1c

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

plotly_express/_core.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,9 @@ def make_mapping(args, variable):
121121
)
122122

123123

124-
def make_trace_kwargs(args, trace_spec, g, mapping_labels, sizeref, color_range):
124+
def make_trace_kwargs(
125+
args, trace_spec, g, mapping_labels, sizeref, color_range, show_colorbar
126+
):
125127

126128
if "line_close" in args and args["line_close"]:
127129
g = g.append(g.iloc[0])
@@ -235,13 +237,10 @@ def make_trace_kwargs(args, trace_spec, g, mapping_labels, sizeref, color_range)
235237
[(1.0 * i) / (1.0 * d), x]
236238
for i, x in enumerate(args["color_continuous_scale"])
237239
]
238-
if color_range is None:
239-
colorbar_container["showscale"] = False
240-
else:
241-
colorbar_container["showscale"] = True
242-
colorbar_container["colorbar"] = dict(title=v_label)
243-
colorbar_container[color_letter + "min"] = color_range[0]
244-
colorbar_container[color_letter + "max"] = color_range[1]
240+
colorbar_container["showscale"] = show_colorbar
241+
colorbar_container[color_letter + "min"] = color_range[0]
242+
colorbar_container[color_letter + "max"] = color_range[1]
243+
colorbar_container["colorbar"] = dict(title=v_label)
245244
elif k == "animation_group":
246245
result["ids"] = g[v]
247246
elif k == "locations":
@@ -811,7 +810,8 @@ def make_figure(args, constructor, trace_patch={}, layout_patch={}):
811810
group,
812811
mapping_labels.copy(),
813812
sizeref,
814-
color_range=color_range if frame_name not in frames else None,
813+
color_range=color_range,
814+
show_colorbar=(frame_name not in frames),
815815
)
816816
)
817817
if frame_name not in frames:

0 commit comments

Comments
 (0)