diff --git a/packages/python/plotly/_plotly_utils/colors/_swatches.py b/packages/python/plotly/_plotly_utils/colors/_swatches.py index ff07ff42907..5bb311f5c3a 100644 --- a/packages/python/plotly/_plotly_utils/colors/_swatches.py +++ b/packages/python/plotly/_plotly_utils/colors/_swatches.py @@ -2,9 +2,11 @@ def _swatches(module_names, module_contents): """ Returns: A `Figure` object. This figure demonstrates the color scales and - sequences in this module, as stacked bar charts. + sequences in this module as stacked bar charts against the default + template's background. """ import plotly.graph_objs as go + import plotly.express as px sequences = [ (k, v) @@ -25,13 +27,14 @@ def _swatches(module_names, module_contents): for name, colors in reversed(sequences) ], layout=dict( - title=module_names, + title=module_names.split(".")[-1].capitalize() + " colorscales", barmode="stack", barnorm="fraction", - template="plotly", + template=px.defaults.template, bargap=0.5, showlegend=False, xaxis=dict(range=[-0.02, 1.02], showticklabels=False, showgrid=False), - height=max(600, 40 * len(sequences)), + height=max(px.defaults.height, 40 * len(sequences)), + width=px.defaults.width, ), )