Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update heatmap #1160

Merged
merged 2 commits into from
Feb 26, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions src/cellrank/pl/_heatmap.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ def heatmap(
lineage_height: float = 0.33,
fontsize: Optional[float] = None,
xlabel: Optional[str] = None,
title: Optional[str] = None,
cmap: colors.ListedColormap = cm.viridis,
dendrogram: bool = True,
return_genes: bool = False,
Expand Down Expand Up @@ -147,6 +148,8 @@ def heatmap(
Size of the title's font.
xlabel
Label on the x-axis. If :obj:`None`, it is determined based on ``time_key``.
title
Title of the figure.
cmap
Colormap to use when visualizing the smoothed expression.
dendrogram
Expand Down Expand Up @@ -340,6 +343,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 +448,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
Loading