%pylab inline
rcParams['figure.figsize']=(10,8)
Populating the interactive namespace from numpy and matplotlib
points = 500
t=arange(0, points)
noise = random.randn(points)*300
fit = 4000*sin(t/40.)**2*exp(-t/200.)
raw = fit + noise
plot(t, fit, label='Fit')
plot(t, raw,'o', label='Raw data')
legend()
ylabel('Raw fluorescence')
xlabel('Time')
savefig('img0.png',dpi=150, bbox_inches="tight")
plot(t, raw, 'o', label='Raw data', color='#0EA16A', alpha=0.75)
plot(t, fit, '#EF5915', lw=3, label='Fit')
legend()
ylabel('Raw fluorescence')
xlabel('Time')
savefig('img1.png',dpi=150, bbox_inches="tight")
plot(t, raw, 'o', label='Raw data', color='#0EA16A', mec='None', alpha=0.75, ms=5)
plot(t, fit, '#EF5915', lw=3, label='Fit')
legend()
ylabel('Raw fluorescence')
xlabel('Time')
savefig('img2.png',dpi=150, bbox_inches="tight")
def myfig():
fig = plt.figure()
ax = fig.gca()
ax.spines['right'].set_visible(False)
ax.spines['top'].set_visible(False)
ax.xaxis.set_ticks_position('bottom')
ax.yaxis.set_ticks_position('left')
return fig, ax
fig,ax = myfig()
ax.plot(t, raw, 'o', label='Raw data', color='#0EA16A', mec='None', alpha=0.75, ms=5)
ax.plot(t,fit,'#EF5915',lw=3,label='Fit')
ax.legend()
ylabel('Raw fluorescence')
xlabel('Time')
savefig('img3.png',dpi=150, bbox_inches="tight")
rcParams['font.sans-serif']=['Fira Sans OT']
rcParams['font.size'] = 14
rcParams['legend.frameon']=False
rcParams['legend.numpoints']=3
rcParams['xtick.major.pad']=4
rcParams['ytick.major.pad']=5
rcParams['xtick.major.width']=1
rcParams['ytick.major.width']=1
rcParams['legend.fontsize']= 'medium'
fig,ax = myfig()
ax.plot(t, raw, 'o', label='Raw data', color='#0EA16A', mec='None', alpha=0.75, ms=5)
ax.plot(t, fit,'#EF5915',lw=3,label='Fit')
ax.legend()
ylabel('Raw fluorescence')
xlabel('Time')
#grid()
savefig('img4.png',dpi=150, bbox_inches="tight")
rcParams['axes.facecolor']='f5f5f5'
rcParams['axes.edgecolor']="444444"
rcParams['grid.linestyle']='-'
rcParams['grid.alpha']=.8
rcParams['grid.color']='white'
rcParams['grid.linewidth']=2
rcParams['axes.axisbelow']= True
rcParams['axes.labelcolor']='444444'
rcParams['text.color']= '444444'
rcParams['xtick.color']= '444444'
rcParams['ytick.color']= '444444'
fig,ax = myfig()
ax.plot(t, raw, 'o', label='Raw data', color='#0EA16A', mec='None', alpha=0.75, ms=5)
ax.plot(t, fit,'#EF5915',lw=3,label='Fit')
ax.legend()
ylabel('Raw fluorescence')
xlabel('Time')
grid()
savefig('img5.png',dpi=150, bbox_inches="tight")