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

savefig

parent 3420ac29
No related branches found
No related tags found
1 merge request!5fix testing and stuff
......@@ -5,7 +5,7 @@ import numpy as np
def fit(numbers:np.ndarray, max_value=None, xlabel='Initial number of cells',
title='', plot=True):
title='', plot=True, save_fig_path=None):
if max_value is None:
max_value = numbers.max()
bins = np.arange(max_value + 1) - .5
......@@ -19,5 +19,11 @@ def fit(numbers:np.ndarray, max_value=None, xlabel='Initial number of cells',
plt.xlabel(xlabel)
plt.title(title)
plt.legend()
if save_fig_path is not None:
try:
plt.savefig(save_fig_path)
print(f'Save histogram {save_fig_path}')
except Exception as e:
print('saving histogram failed', e.args)
plt.show()
return l
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment