Skip to content

Commit

Permalink
Update state plotting (#1177)
Browse files Browse the repository at this point in the history
* Update `TermStatesEstimator::_plot_discrete`

Add outline if plotted in the same plot.

* Update ground truth figures

Update ground truth figures for unit tests using
new API.
  • Loading branch information
WeilerP authored Mar 15, 2024
1 parent 4ae88b9 commit 9069571
Show file tree
Hide file tree
Showing 19 changed files with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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]]
Expand All @@ -456,6 +461,7 @@ def _plot_discrete(
self.adata,
color=color + keys,
title=color + title,
add_outline=outline,
**kwargs,
)
# fmt: on
Expand Down
Binary file modified tests/_ground_truth_figures/scvelo_final_states.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/_ground_truth_figures/scvelo_final_states_clusters.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/_ground_truth_figures/scvelo_gpcca_final_states.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/_ground_truth_figures/scvelo_gpcca_final_states_cmap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/_ground_truth_figures/scvelo_gpcca_final_states_time.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/_ground_truth_figures/scvelo_gpcca_final_states_title.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/_ground_truth_figures/scvelo_gpcca_meta_states.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/_ground_truth_figures/scvelo_gpcca_meta_states_cmap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/_ground_truth_figures/scvelo_gpcca_meta_states_time.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/_ground_truth_figures/scvelo_gpcca_meta_states_title.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 9069571

Please sign in to comment.