Skip to content

Commit

Permalink
Update heatmap
Browse files Browse the repository at this point in the history
Add argument `title`.
  • Loading branch information
WeilerP committed Feb 25, 2024
1 parent 7c8b9d4 commit 98304d9
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/cellrank/pl/_heatmap.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ def heatmap(
dpi: Optional[int] = None,
save: Optional[Union[str, pathlib.Path]] = None,
gene_order: Optional[Sequence[str]] = None,
title: Optional[str] = None,
**kwargs: Any,
) -> Optional[Union[Dict[str, pd.DataFrame], Tuple[_return_model_type, Dict[str, pd.DataFrame]]]]:
"""Plot a heatmap of smoothed gene expression along specified lineages.
Expand Down Expand Up @@ -340,6 +341,8 @@ def color_fill_rec(ax, xs, y1, y2, colors=None, cmap=cmap, **kwargs) -> None:
labelbottom=True,
)
ax.set_xlabel(xlabel)
if title is not None:
ax.set_title(title)

return fig, None

Expand Down Expand Up @@ -443,6 +446,8 @@ def _(gene_order: Optional[Sequence[str]] = None) -> Tuple[List[plt.Figure], pd.
g.ax_heatmap.set_xlabel(xlabel)
g.ax_heatmap.set_xticks(np.linspace(0, len(df.columns), _N_XTICKS))
g.ax_heatmap.set_xticklabels([round(n, 3) for n in np.linspace(x_min, x_max, _N_XTICKS)])
if title is not None:
g.ax_heatmap.set_title(title)
# fmt: on
if show_clust:
# robustly show dendrogram, because gene names can be long
Expand Down

0 comments on commit 98304d9

Please sign in to comment.