Skip to content

Commit 1b8ec25

Browse files
committed
Handle string inputs with get_colorscale
1 parent 10be9df commit 1b8ec25

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

Diff for: packages/python/plotly/_plotly_utils/colors/__init__.py

+1-7
Original file line numberDiff line numberDiff line change
@@ -854,13 +854,7 @@ def sample_colorscale(colorscale, samplepoints, low=0.0, high=1.0, colortype="rg
854854
validate_colorscale(colorscale)
855855
except exceptions.PlotlyError:
856856
if isinstance(colorscale, str):
857-
if colorscale in PLOTLY_SCALES:
858-
colorscale = PLOTLY_SCALES[colorscale]
859-
else:
860-
raise exceptions.PlotlyError(
861-
"If your colorscale variable is a string, "
862-
"it must be a Plotly scale."
863-
)
857+
colorscale = get_colorscale(colorscale)
864858
else:
865859
colorscale = make_colorscale(colorscale)
866860

0 commit comments

Comments
 (0)