Commit d3ca5ba
Fix categorical colors wrongly assigned to points with non-sequential index (#358)
When points have a shuffled or non-sequential index (e.g. from .sample()
or .subset()), _reparse_points sorts rows by index while adata.X retains
the original order. This causes get_values to return colors in sorted
order, misaligned with coordinates. Resetting the index to sequential
before adata construction and reparsing ensures both share the same
positional order.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>1 parent 55d59b7 commit d3ca5ba
4 files changed
Lines changed: 25 additions & 1 deletion
File tree
- src/spatialdata_plot/pl
- tests
- _images
- pl
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
743 | 743 | | |
744 | 744 | | |
745 | 745 | | |
| 746 | + | |
| 747 | + | |
| 748 | + | |
746 | 749 | | |
747 | 750 | | |
748 | 751 | | |
| |||
758 | 761 | | |
759 | 762 | | |
760 | 763 | | |
761 | | - | |
| 764 | + | |
762 | 765 | | |
763 | 766 | | |
764 | 767 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
606 | 606 | | |
607 | 607 | | |
608 | 608 | | |
| 609 | + | |
| 610 | + | |
| 611 | + | |
| 612 | + | |
| 613 | + | |
| 614 | + | |
| 615 | + | |
| 616 | + | |
| 617 | + | |
| 618 | + | |
| 619 | + | |
| 620 | + | |
| 621 | + | |
| 622 | + | |
| 623 | + | |
| 624 | + | |
| 625 | + | |
| 626 | + | |
| 627 | + | |
| 628 | + | |
| 629 | + | |
609 | 630 | | |
610 | 631 | | |
611 | 632 | | |
| |||
0 commit comments