Skip to content
Snippets Groups Projects
Commit 512c3824 authored by Andrey Aristov's avatar Andrey Aristov
Browse files

more plots

parent 6c100174
No related branches found
No related tags found
No related merge requests found
...@@ -13,19 +13,32 @@ def combine(table_day1_path, table_day2_path, table_output_path, swarmplot_outpu ...@@ -13,19 +13,32 @@ def combine(table_day1_path, table_day2_path, table_output_path, swarmplot_outpu
day1.to_csv(table_output_path, index=None) day1.to_csv(table_output_path, index=None)
n_max = int(day1.n_cells.mean() * 3) n_max = int(day1.n_cells.mean() * 3)
plot_swarm(day1, n_max=n_max, path=swarmplot_output_path) plot_swarm_counts(day1, n_max=n_max, path=swarmplot_output_path)
plot_swarm_intensity(day1, n_max=n_max, path=swarmplot_output_path.replace('.png', '_intensities.png'))
plot_probs(day1, n_max=n_max,path=prob_plot_path) plot_probs(day1, n_max=n_max,path=prob_plot_path)
plot_probs_log(day1, n_max=n_max,path=prob_plot_path.replace('.png', '_log.png'))
def plot_swarm(table:pd.DataFrame, n_max:int=5, path=None): def plot_swarm_counts(table:pd.DataFrame, n_max:int=5, path=None):
fig, ax = plt.subplots(dpi=300) fig, ax = plt.subplots(dpi=300)
sns.swarmplot(ax=ax, data=table.query(f'n_cells < {n_max}'), x='[AB]', y='n_cells_final', hue='n_cells', dodge=True, size=1 ) sns.swarmplot(ax=ax, data=table.query(f'n_cells < {n_max}'), x='[AB]', y='n_cells_final', hue='n_cells', dodge=True, size=1 )
fig.savefig(path) fig.savefig(path)
def plot_swarm_intensity(table:pd.DataFrame, n_max:int=5, path=None):
fig, ax = plt.subplots(dpi=300)
sns.swarmplot(ax=ax, data=table.query(f'n_cells < {n_max}'), x='[AB]', y='intensity_final', hue='n_cells', dodge=True, size=1 )
fig.savefig(path)
def plot_probs(table:pd.DataFrame, n_max:int=5, path=None): def plot_probs(table:pd.DataFrame, n_max:int=5, path=None):
fig, ax = plt.subplots(dpi=300) fig, ax = plt.subplots(dpi=300)
sns.lineplot(ax=ax, data=table.query(f'n_cells < {n_max}'), x='[AB]', y='final_state', hue='n_cells') sns.lineplot(ax=ax, data=table.query(f'n_cells < {n_max}'), x='[AB]', y='final_state', hue='n_cells')
fig.savefig(path) fig.savefig(path)
def plot_probs_log(table:pd.DataFrame, n_max:int=5, path=None):
fig, ax = plt.subplots(dpi=300)
sns.lineplot(ax=ax, data=table.query(f'n_cells < {n_max}'), x='[AB]', y='final_state', hue='n_cells')
ax.set_xscale('log')
fig.savefig(path)
if __name__ == "__main__": if __name__ == "__main__":
fire.Fire(combine) fire.Fire(combine)
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment