plotly.py
plotly.py copied to clipboard
[Fix] Always respect user-specified `color_continuous_scale`
Fixes https://github.com/plotly/plotly.py/issues/5433. When a user explicitly provides color_continuous_scale, it should always be respected, even if the template has coloraxis_autocolorscale=True. Previously, the template's autocolorscale setting would override the user's explicit colorscale.
A couple of tests are failing but I'm pretty sure it's not my fault.
Here's the behaviour now. Before this PR, all plots in the above table would have looked the same with the exception of the top left one, where the user-specified color_continuous_scale would have been ignored.
| autocolorscale=True | autocolorscale=False |
|---|---|
Code PR
- [x] I have read through the contributing notes and understand the structure of the package. In particular, if my PR modifies code of
plotly.graph_objects, my modifications concern the code generator and not the generated files. - [x] I have added tests or modified existing tests.
- [ ] For a new feature, I have added documentation examples (please see the doc checklist as well).
- [x] I have added a CHANGELOG entry if changing anything substantial.
- [ ] For a new feature or a change in behavior, I have updated the relevant docstrings in the code.