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

4 crops

parent fefb711a
No related branches found
No related tags found
1 merge request!5fix testing and stuff
Pipeline #68155 failed
%% Cell type:markdown id: tags:
# Bacteria paper figures
%% Cell type:markdown id: tags:
## Method figure
%% Cell type:code id: tags:
``` python
import numpy as np
from PIL import Image
from glob import glob
import matplotlib.pyplot as plt
```
%% Cell type:code id: tags:
``` python
paths = sorted(glob('/home/aaristov/Multicell/Andrey/docs/bacteria-paper/*ng*.png'))
paths
```
%% Output
['/home/aaristov/Multicell/Andrey/docs/bacteria-paper/00ng-Composite.aligned-big-labels-1-1.png',
'/home/aaristov/Multicell/Andrey/docs/bacteria-paper/00ng-Composite.aligned-big-labels-2.png',
'/home/aaristov/Multicell/Andrey/docs/bacteria-paper/08ng-Composite.aligned-big-labels-1.png',
'/home/aaristov/Multicell/Andrey/docs/bacteria-paper/08ng-Composite.aligned.labels-big-1.png']
%% Cell type:code id: tags:
``` python
imgs = list(map(Image.open, paths))
```
%% Cell type:code id: tags:
``` python
np.array(imgs[0]).shape
```
%% Output
(1182, 1890, 3)
%% Cell type:code id: tags:
``` python
fig, ((ax1, ax2), (ax3, ax4)) = plt.subplots(2,2, dpi=120)
ax1.imshow(np.array(imgs[1]))
ax2.imshow(np.array(imgs[0]))
ax3.imshow(np.array(imgs[3]))
ax4.imshow(np.array(imgs[2]))
ax1.axis('off')
ax2.axis('off')
ax3.axis('off')
ax4.axis('off')
ax1.set_title('0 ng, 0 h')
ax2.set_title('0 ng, 24 h')
ax3.set_title('8 ng, 0 h')
ax4.set_title('8 ng, 24 h')
fig.suptitle('Title of figure', fontsize=20)
print(fig)
# [a.imshow(im) for a, im in zip(ax, imgs)]
# plt.show()
```
%% Output
Figure(720x480)
%% Cell type:code id: tags:
``` python
```
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