Skip to content

Commit

Permalink
Update scatter and update_axes (#1205)
Browse files Browse the repository at this point in the history
Add keyword `aspect` to set axis aspect.
  • Loading branch information
WeilerP authored Feb 22, 2024
1 parent 04f4cc9 commit ffe2cd3
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
5 changes: 4 additions & 1 deletion scvelo/plotting/scatter.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ def scatter(
show=None,
save=None,
ax=None,
aspect="auto",
**kwargs,
):
"""Scatter plot along observations or variables axes.
Expand Down Expand Up @@ -770,7 +771,9 @@ def scatter(

set_label(xlabel, ylabel, fontsize, basis, ax=ax)
set_title(title, layer, color, fontsize, ax=ax)
update_axes(ax, xlim, ylim, fontsize, is_embedding, frameon, figsize)
update_axes(
ax, xlim, ylim, fontsize, is_embedding, frameon, figsize, aspect=aspect
)
if add_margin:
set_margin(ax, x, y, add_margin)
if colorbar is not False:
Expand Down
3 changes: 3 additions & 0 deletions scvelo/plotting/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -466,6 +466,7 @@ def update_axes(
is_embedding=False,
frameon=None,
figsize=None,
aspect="auto",
):
"""TODO."""
if xlim is not None:
Expand Down Expand Up @@ -520,6 +521,8 @@ def update_axes(
ax.tick_params(which="both", **kwargs)
ax.set_frame_on(False)

ax.set_aspect(aspect)

if rcParams["savefig.transparent"]:
ax.patch.set_alpha(0)

Expand Down

0 comments on commit ffe2cd3

Please sign in to comment.