Skip to content

Commit

Permalink
Fix #2681
Browse files Browse the repository at this point in the history
Checks if current axis is colorbar before trying to set the name
  • Loading branch information
jeskowagner committed Oct 11, 2023
1 parent 616d580 commit e762eac
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions scanpy/plotting/_tools/scatterplots.py
Expand Up @@ -891,6 +891,8 @@ def pca(
# edit axis labels in returned figure
fig = embedding(adata, 'pca', return_fig=return_fig, **kwargs)
for ax in fig.axes:
if ax.get_label() == "<colorbar>":
continue
ax.set_xlabel(label_dict[ax.xaxis.get_label().get_text()])
ax.set_ylabel(label_dict[ax.yaxis.get_label().get_text()])
return fig
Expand Down

0 comments on commit e762eac

Please sign in to comment.