Commit 1b1fa93
committed
Fix: Respect user-specified color_continuous_scale when template has autocolorscale=True
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.
The fix tracks whether color_continuous_scale was explicitly provided by the
user (before apply_default_cascade fills it from template/defaults), and only
sets autocolorscale=False when the user explicitly provided a colorscale. This
preserves automatic diverging palette selection when colorscale comes from
template/defaults.
Changes:
- plotly/express/_core.py: Track user_provided_colorscale and conditionally
set autocolorscale=False only when user explicitly provides colorscale
- plotly/express/_imshow.py: Same fix for imshow() function1 parent f083977 commit 1b1fa93
2 files changed
Lines changed: 24 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2486 | 2486 | | |
2487 | 2487 | | |
2488 | 2488 | | |
| 2489 | + | |
| 2490 | + | |
| 2491 | + | |
| 2492 | + | |
| 2493 | + | |
| 2494 | + | |
2489 | 2495 | | |
2490 | 2496 | | |
2491 | 2497 | | |
| |||
2704 | 2710 | | |
2705 | 2711 | | |
2706 | 2712 | | |
2707 | | - | |
| 2713 | + | |
2708 | 2714 | | |
2709 | 2715 | | |
2710 | 2716 | | |
| |||
2715 | 2721 | | |
2716 | 2722 | | |
2717 | 2723 | | |
| 2724 | + | |
| 2725 | + | |
| 2726 | + | |
| 2727 | + | |
| 2728 | + | |
2718 | 2729 | | |
2719 | 2730 | | |
2720 | 2731 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
233 | 233 | | |
234 | 234 | | |
235 | 235 | | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
236 | 242 | | |
237 | 243 | | |
238 | 244 | | |
| |||
419 | 425 | | |
420 | 426 | | |
421 | 427 | | |
422 | | - | |
| 428 | + | |
423 | 429 | | |
424 | 430 | | |
425 | 431 | | |
426 | 432 | | |
427 | 433 | | |
428 | 434 | | |
429 | 435 | | |
| 436 | + | |
| 437 | + | |
| 438 | + | |
| 439 | + | |
| 440 | + | |
430 | 441 | | |
431 | 442 | | |
432 | 443 | | |
| |||
0 commit comments