Skip to content

Commit

Permalink
Backport PR #2682: Fix #2681
Browse files Browse the repository at this point in the history
  • Loading branch information
jeskowagner authored and meeseeksmachine committed Oct 16, 2023
1 parent a20bea6 commit 503876d
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions scanpy/plotting/_tools/scatterplots.py
Original file line number Diff line number Diff line change
Expand Up @@ -886,8 +886,10 @@ def pca(
# edit axis labels in returned figure
fig = embedding(adata, 'pca', return_fig=return_fig, **kwargs)
for ax in fig.axes:
ax.set_xlabel(label_dict[ax.xaxis.get_label().get_text()])
ax.set_ylabel(label_dict[ax.yaxis.get_label().get_text()])
if xlabel := label_dict.get(ax.xaxis.get_label().get_text()):
ax.set_xlabel(xlabel)
if ylabel := label_dict.get(ax.yaxis.get_label().get_text()):
ax.set_ylabel(ylabel)
return fig

else:
Expand Down

0 comments on commit 503876d

Please sign in to comment.