Skip to content

Commit a02e192

Browse files
committed
Included autopep formatting. Will need to be done again after functionality has been ensured
1 parent aac3c31 commit a02e192

18 files changed

+1557
-906
lines changed

analysis/functions/beeswarm.py

+13-4
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,16 @@
22
import matplotlib.pyplot as plt
33
import numpy as np
44

5-
def beeswarm_coordinates(df, val_col, xscale="log", figsize=(9,9), pointsize=7, prefix=''):
5+
6+
def beeswarm_coordinates(
7+
df,
8+
val_col,
9+
xscale="log",
10+
figsize=(
11+
9,
12+
9),
13+
pointsize=7,
14+
prefix=''):
615
'''small hack: don't show image, but use seaborn to calculate coordinates.
716
Could not find a solution performing as well as the seaborn implementation'''
817
fig, ax = plt.subplots(figsize=figsize)
@@ -11,9 +20,9 @@ def beeswarm_coordinates(df, val_col, xscale="log", figsize=(9,9), pointsize=7,
1120
# get precise data coordinates
1221
x, y = np.array(ax.collections[0].get_offsets()).T
1322
df = df.sort_values(by=val_col, ascending=True)
14-
df[prefix+'x'] = x
15-
df[prefix+'y'] = y
23+
df[prefix + 'x'] = x
24+
df[prefix + 'y'] = y
1625
xlim = ax.get_xlim()
1726
ylim = ax.get_ylim()
1827
plt.close('all')
19-
return df, xlim, ylim
28+
return df, xlim, ylim

0 commit comments

Comments
 (0)