Skip to content

Commit ffe2cd3

Browse files
authored
Update scatter and update_axes (#1205)
Add keyword `aspect` to set axis aspect.
1 parent 04f4cc9 commit ffe2cd3

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

scvelo/plotting/scatter.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,7 @@ def scatter(
119119
show=None,
120120
save=None,
121121
ax=None,
122+
aspect="auto",
122123
**kwargs,
123124
):
124125
"""Scatter plot along observations or variables axes.
@@ -770,7 +771,9 @@ def scatter(
770771

771772
set_label(xlabel, ylabel, fontsize, basis, ax=ax)
772773
set_title(title, layer, color, fontsize, ax=ax)
773-
update_axes(ax, xlim, ylim, fontsize, is_embedding, frameon, figsize)
774+
update_axes(
775+
ax, xlim, ylim, fontsize, is_embedding, frameon, figsize, aspect=aspect
776+
)
774777
if add_margin:
775778
set_margin(ax, x, y, add_margin)
776779
if colorbar is not False:

scvelo/plotting/utils.py

+3
Original file line numberDiff line numberDiff line change
@@ -466,6 +466,7 @@ def update_axes(
466466
is_embedding=False,
467467
frameon=None,
468468
figsize=None,
469+
aspect="auto",
469470
):
470471
"""TODO."""
471472
if xlim is not None:
@@ -520,6 +521,8 @@ def update_axes(
520521
ax.tick_params(which="both", **kwargs)
521522
ax.set_frame_on(False)
522523

524+
ax.set_aspect(aspect)
525+
523526
if rcParams["savefig.transparent"]:
524527
ax.patch.set_alpha(0)
525528

0 commit comments

Comments
 (0)