Skip to content
Snippets Groups Projects
Commit 9c0f4b3a authored by Lars Hubatsch's avatar Lars Hubatsch
Browse files

Cosmetic changes.

parent 82aa51be
No related branches found
No related tags found
No related merge requests found
%% Cell type:markdown id: tags:
### FRAP geometries
%% Cell type:code id: tags:
``` python
from fem_sol import frap_solver
import matplotlib.pyplot as plt
import numpy as np
```
%% Cell type:code id: tags:
``` python
font = {'family' : 'normal',
'weight' : 'normal',
'size' : 12}
import matplotlib
matplotlib.rc('font', **font)
def make_graph_pretty(xlab, ylab, loc=0, markerfirst=True, handlelength=None):
color1 = 'black'#'darkorange'
color2 = (0, 0, 0)
color2 = (1, 1, 1)
ax = plt.gca()
ax.tick_params(axis='x', colors=color1, which='both')
ax.tick_params(axis='y', colors=color1, which='both')
plt.xlabel(xlab, color=color1)
plt.ylabel(ylab, color=color1)
ax.spines['left'].set_color(color1)
ax.spines['bottom'].set_color(color1)
# Hide the right and top spines
ax.spines['right'].set_visible(False)
ax.spines['top'].set_visible(False)
ax.set_facecolor(color2)
plt.gcf().subplots_adjust(bottom=0.17, left=0.15)
plt.legend(frameon=False, loc=loc, labelspacing=0.1,
markerfirst=markerfirst, handlelength=handlelength)
```
%% Cell type:code id: tags:
``` python
m = ['Meshes/multi_drop_gauss.xml', 'Meshes/multi_drop_gauss_med.xml',
'Meshes/multi_drop_gauss_far.xml']
point_lists = [[[4, 4.5, 0.5], [4, 3.5, 0.5], [3.5, 4, 0.5], [4.5, 4, 0.5]],
[[4, 5, 0.5], [4, 3, 0.5], [3, 4, 0.5], [5, 4, 0.5]],
[[4, 5.5, 0.5], [4, 2.5, 0.5], [2.5, 4, 0.5], [5.5, 4, 0.5]]]
f_i = []
for j in range(len(m)):
f = frap_solver([4, 4, 0.5], m[j], name=str(j), point_list=point_lists[j],
T=3)
f.solve_frap()
f_i.append(f)
```
%% Cell type:code id: tags:
``` python
for i in range(len(cs[0])):
plt.plot([np.mean(x[1:49])/0.8 for x in cs[0][0:i]], label='dist=0.5')
plt.plot([np.mean(x[1:49])/0.8 for x in cs[1][0:i]], label='dist=1')
plt.plot([np.mean(x[1:49])/0.8 for x in cs[2][0:i]], label='dist=1.5')
plt.plot(range(0, 100), np.ones(100), linestyle='--', color='k')
plt.ylim((0, 1.1))
plt.xlim((0, 100))
make_graph_pretty('t (a.u.)', 'intensity (a.u)', loc=4)
# plt.savefig('img_'+str(i)+'.png', dpi=300)
plt.show()
```
%% Cell type:code id: tags:
``` python
f_coverslip = frap_solver([4, 4, 0.5], 'Meshes/single_drop_coverslip.xml',
name='FRAP_coverslip', T=300)
f_coverslip.solve_frap()
f_symmetric = frap_solver([4, 4, 4], 'Meshes/single_drop_symmetric.xml',
name='FRAP_symmetric', T=300)
f_symmetric.solve_frap()
```
%% Cell type:code id: tags:
``` python
plt.plot([np.mean(x[1:49])/0.8 for x in f_coverslip.cs], label='coverslip')
plt.plot([np.mean(x[1:49])/0.8 for x in f_symmetric.cs], label='symmetric')
plt.plot(range(0, 300), np.ones(300), linestyle='--', color='k')
plt.ylim((0, 1.1))
plt.xlim((0, 300))
make_graph_pretty('t (a.u.)', 'intensity (a.u)', loc=4)
```
%% Cell type:code id: tags:
``` python
f_coverslip.cs
```
%% 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