Skip to content

Commit

Permalink
Fig1G Transition type
Browse files Browse the repository at this point in the history
  • Loading branch information
dhruvm9 committed Sep 14, 2023
1 parent 2ae03eb commit c3d618d
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions Analysis/Figure1G.py
Original file line number Diff line number Diff line change
Expand Up @@ -184,13 +184,13 @@

summary = pd.DataFrame()
summary['corr'] = pd.concat([DUcorr,UDcorr])
summary['type'] = pd.concat([DUtype,UDtype])
summary['Transition'] = pd.concat([DUtype,UDtype])

#%% Plotting

sns.set_style('white')
palette = ['royalblue', 'lightsteelblue']
ax = sns.violinplot( x = summary['type'], y= summary['corr'] , data = summary, dodge = False,
ax = sns.violinplot( x = summary['Transition'], y= summary['corr'] , data = summary, dodge = False,
palette = palette,cut = 2,
scale="width", inner=None)
ax.tick_params(bottom=True, left=True)
Expand All @@ -199,10 +199,10 @@
for violin in ax.collections:
x0, y0, width, height = violin.get_paths()[0].get_extents().bounds
violin.set_clip_path(plt.Rectangle((x0, y0), width / 2, height, transform=ax.transData))
sns.boxplot(x = summary['type'], y = summary['corr'] , data = summary, saturation = 1, showfliers = False,
sns.boxplot(x = summary['Transition'], y = summary['corr'] , data = summary, saturation = 1, showfliers = False,
width = 0.3, boxprops = {'zorder': 3, 'facecolor': 'none'}, ax = ax)
old_len_collections = len(ax.collections)
sns.swarmplot(x = summary['type'], y = summary['corr'], data = summary, color = 'k', dodge = False, ax = ax)
sns.swarmplot(x = summary['Transition'], y = summary['corr'], data = summary, color = 'k', dodge = False, ax = ax)

for dots in ax.collections[old_len_collections:]:
dots.set_offsets(dots.get_offsets())
Expand Down

0 comments on commit c3d618d

Please sign in to comment.