Skip to content

Commit

Permalink
RO fixing issue scverse#2778
Browse files Browse the repository at this point in the history
  • Loading branch information
Rafael-Silva-Oliveira committed Dec 8, 2023
1 parent 0581400 commit 15c7c60
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions scanpy/plotting/_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -1135,6 +1135,13 @@ def circles(
# You can set `facecolor` with an array for each patch,
# while you can only set `facecolors` with a value for all.
if scale_factor != 1.0:
# Check and convert to integers if needed - Fix for issue # 2778
if not np.issubdtype(x.dtype, np.integer) or not np.issubdtype(y.dtype, np.integer):
try:
x = x.astype(int)
y = y.astype(int)
except ValueError as e:
print("Error converting to int:", e)
x = x * scale_factor
y = y * scale_factor
zipped = np.broadcast(x, y, s)
Expand Down

0 comments on commit 15c7c60

Please sign in to comment.