@@ -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