diff --git a/src/cellrank/estimators/terminal_states/_term_states_estimator.py b/src/cellrank/estimators/terminal_states/_term_states_estimator.py index 67fc35027..c20db58a0 100644 --- a/src/cellrank/estimators/terminal_states/_term_states_estimator.py +++ b/src/cellrank/estimators/terminal_states/_term_states_estimator.py @@ -440,10 +440,15 @@ def _plot_discrete( # fmt: off with RandomKeys(self.adata, n=1 if same_plot else len(states), where="obs") as keys: if same_plot: + outline = _data.cat.categories.to_list() + _data = _data.cat.add_categories(["nan"]).fillna("nan") + states.append("nan") + color_mapper["nan"] = "#dedede" self.adata.obs[keys[0]] = _data self.adata.uns[f"{keys[0]}_colors"] = [color_mapper[name] for name in states] title = _title if title is None else title else: + outline = None for key, cat in zip(keys, states): self.adata.obs[key] = _data.cat.set_categories([cat]) self.adata.uns[f"{key}_colors"] = [color_mapper[cat]] @@ -456,6 +461,7 @@ def _plot_discrete( self.adata, color=color + keys, title=color + title, + add_outline=outline, **kwargs, ) # fmt: on diff --git a/tests/_ground_truth_figures/scvelo_final_states.png b/tests/_ground_truth_figures/scvelo_final_states.png index 34af240f5..c505eea21 100644 Binary files a/tests/_ground_truth_figures/scvelo_final_states.png and b/tests/_ground_truth_figures/scvelo_final_states.png differ diff --git a/tests/_ground_truth_figures/scvelo_final_states_clusters.png b/tests/_ground_truth_figures/scvelo_final_states_clusters.png index f69b31974..ad1dfd44f 100644 Binary files a/tests/_ground_truth_figures/scvelo_final_states_clusters.png and b/tests/_ground_truth_figures/scvelo_final_states_clusters.png differ diff --git a/tests/_ground_truth_figures/scvelo_gpcca_final_states.png b/tests/_ground_truth_figures/scvelo_gpcca_final_states.png index e6066fc05..6dc90c434 100644 Binary files a/tests/_ground_truth_figures/scvelo_gpcca_final_states.png and b/tests/_ground_truth_figures/scvelo_gpcca_final_states.png differ diff --git a/tests/_ground_truth_figures/scvelo_gpcca_final_states_cluster_key.png b/tests/_ground_truth_figures/scvelo_gpcca_final_states_cluster_key.png index fcff8a6ee..7e6666858 100644 Binary files a/tests/_ground_truth_figures/scvelo_gpcca_final_states_cluster_key.png and b/tests/_ground_truth_figures/scvelo_gpcca_final_states_cluster_key.png differ diff --git a/tests/_ground_truth_figures/scvelo_gpcca_final_states_cmap.png b/tests/_ground_truth_figures/scvelo_gpcca_final_states_cmap.png index 47805cabc..5dbe40a0c 100644 Binary files a/tests/_ground_truth_figures/scvelo_gpcca_final_states_cmap.png and b/tests/_ground_truth_figures/scvelo_gpcca_final_states_cmap.png differ diff --git a/tests/_ground_truth_figures/scvelo_gpcca_final_states_discrete.png b/tests/_ground_truth_figures/scvelo_gpcca_final_states_discrete.png index e6066fc05..6dc90c434 100644 Binary files a/tests/_ground_truth_figures/scvelo_gpcca_final_states_discrete.png and b/tests/_ground_truth_figures/scvelo_gpcca_final_states_discrete.png differ diff --git a/tests/_ground_truth_figures/scvelo_gpcca_final_states_lineages.png b/tests/_ground_truth_figures/scvelo_gpcca_final_states_lineages.png index 7b4cf36cc..19f8cb2a4 100644 Binary files a/tests/_ground_truth_figures/scvelo_gpcca_final_states_lineages.png and b/tests/_ground_truth_figures/scvelo_gpcca_final_states_lineages.png differ diff --git a/tests/_ground_truth_figures/scvelo_gpcca_final_states_no_same_plot.png b/tests/_ground_truth_figures/scvelo_gpcca_final_states_no_same_plot.png index 47805cabc..5dbe40a0c 100644 Binary files a/tests/_ground_truth_figures/scvelo_gpcca_final_states_no_same_plot.png and b/tests/_ground_truth_figures/scvelo_gpcca_final_states_no_same_plot.png differ diff --git a/tests/_ground_truth_figures/scvelo_gpcca_final_states_time.png b/tests/_ground_truth_figures/scvelo_gpcca_final_states_time.png index e6066fc05..6dc90c434 100644 Binary files a/tests/_ground_truth_figures/scvelo_gpcca_final_states_time.png and b/tests/_ground_truth_figures/scvelo_gpcca_final_states_time.png differ diff --git a/tests/_ground_truth_figures/scvelo_gpcca_final_states_title.png b/tests/_ground_truth_figures/scvelo_gpcca_final_states_title.png index 32e4a5dee..52f9d2ca0 100644 Binary files a/tests/_ground_truth_figures/scvelo_gpcca_final_states_title.png and b/tests/_ground_truth_figures/scvelo_gpcca_final_states_title.png differ diff --git a/tests/_ground_truth_figures/scvelo_gpcca_meta_states.png b/tests/_ground_truth_figures/scvelo_gpcca_meta_states.png index 1d24c9f0f..88323cc2e 100644 Binary files a/tests/_ground_truth_figures/scvelo_gpcca_meta_states.png and b/tests/_ground_truth_figures/scvelo_gpcca_meta_states.png differ diff --git a/tests/_ground_truth_figures/scvelo_gpcca_meta_states_cluster_key.png b/tests/_ground_truth_figures/scvelo_gpcca_meta_states_cluster_key.png index 67c6ea40a..8d601de87 100644 Binary files a/tests/_ground_truth_figures/scvelo_gpcca_meta_states_cluster_key.png and b/tests/_ground_truth_figures/scvelo_gpcca_meta_states_cluster_key.png differ diff --git a/tests/_ground_truth_figures/scvelo_gpcca_meta_states_cmap.png b/tests/_ground_truth_figures/scvelo_gpcca_meta_states_cmap.png index b951975ac..5180cc426 100644 Binary files a/tests/_ground_truth_figures/scvelo_gpcca_meta_states_cmap.png and b/tests/_ground_truth_figures/scvelo_gpcca_meta_states_cmap.png differ diff --git a/tests/_ground_truth_figures/scvelo_gpcca_meta_states_discrete.png b/tests/_ground_truth_figures/scvelo_gpcca_meta_states_discrete.png index 1d24c9f0f..88323cc2e 100644 Binary files a/tests/_ground_truth_figures/scvelo_gpcca_meta_states_discrete.png and b/tests/_ground_truth_figures/scvelo_gpcca_meta_states_discrete.png differ diff --git a/tests/_ground_truth_figures/scvelo_gpcca_meta_states_lineages.png b/tests/_ground_truth_figures/scvelo_gpcca_meta_states_lineages.png index 0a632a09d..65c863d44 100644 Binary files a/tests/_ground_truth_figures/scvelo_gpcca_meta_states_lineages.png and b/tests/_ground_truth_figures/scvelo_gpcca_meta_states_lineages.png differ diff --git a/tests/_ground_truth_figures/scvelo_gpcca_meta_states_no_same_plot.png b/tests/_ground_truth_figures/scvelo_gpcca_meta_states_no_same_plot.png index b951975ac..5180cc426 100644 Binary files a/tests/_ground_truth_figures/scvelo_gpcca_meta_states_no_same_plot.png and b/tests/_ground_truth_figures/scvelo_gpcca_meta_states_no_same_plot.png differ diff --git a/tests/_ground_truth_figures/scvelo_gpcca_meta_states_time.png b/tests/_ground_truth_figures/scvelo_gpcca_meta_states_time.png index 1d24c9f0f..88323cc2e 100644 Binary files a/tests/_ground_truth_figures/scvelo_gpcca_meta_states_time.png and b/tests/_ground_truth_figures/scvelo_gpcca_meta_states_time.png differ diff --git a/tests/_ground_truth_figures/scvelo_gpcca_meta_states_title.png b/tests/_ground_truth_figures/scvelo_gpcca_meta_states_title.png index 32e4a5dee..52f9d2ca0 100644 Binary files a/tests/_ground_truth_figures/scvelo_gpcca_meta_states_title.png and b/tests/_ground_truth_figures/scvelo_gpcca_meta_states_title.png differ