return Label(s+spaces, s+spaces, fontsize(fsize), align=align);
}
-void graphFile(picture pic=currentpicture, string file="datafile",
- int xcol=0, int ycol=1,
- real xscale=1, real yscale=1, pen p=red,
+void graphData(picture pic=currentpicture, real[] x, real[] y,
+ real xscale=1, real yscale=1, real dx=0, real dy=0, pen p=red,
path mpath=scale(0.8mm)*unitcircle,
markroutine markroutine=marknodes,
string t="Title",
bool dots=false) {
pen pline=p;
marker mk = nomarker;
- file fin=input(file).line();
- real[][] a=fin.dimension(0,0);
- a=transpose(a);
- real[] x=a[xcol];
- real[] y=a[ycol];
if (dots == true) {
pline = invisible;
mk = marker(mpath, markroutine, p);
}
if (t != "Title") {
- draw(pic=pic, graph(pic,xscale*x,yscale*y), p=pline, legend=sLabel(t,extra_spaces=1), marker=mk);
+ draw(pic=pic, graph(pic,xscale*(x+dx),yscale*(y+dy)), p=pline,
+ legend=sLabel(t,extra_spaces=1), marker=mk);
} else {
- draw(pic=pic, graph(pic,xscale*x,yscale*y), p=pline, marker=mk);
+ draw(pic=pic, graph(pic,xscale*(x+dx),yscale*(y+dy)), p=pline, marker=mk);
}
}
+void graphFile(picture pic=currentpicture, string file="datafile",
+ int xcol=0, int ycol=1,
+ real xscale=1, real yscale=1, real dx=0, real dy=0, pen p=red,
+ path mpath=scale(0.8mm)*unitcircle,
+ markroutine markroutine=marknodes,
+ string t="Title",
+ bool dots=false) {
+ file fin=input(file).line();
+ real[][] a=fin.dimension(0,0);
+ a=transpose(a);
+ real[] x=a[xcol];
+ real[] y=a[ycol];
+ graphData(pic=pic, x=x, y=y, xscale=xscale, yscale=yscale, dx=dx, dy=dy, p=p,
+ mpath=mpath, markroutine=markroutine, t=t, dots=dots);
+}
+
void fitFile(picture pic=currentpicture, string file="fitparamfile",
int pcol=0, real f(real x, real[] params),
real xmin=realMin, real xmax=realMax,
+from site_cons.site_init import link_wtk_graph
+
+
+FIGURES = ['sim-sawtooth']
+
# Get the passed in environment.
Import('env')
-for gp in Glob('*.gp'):
- env.Gnuplot(gp)
+wtk_graph = link_wtk_graph(env)
+
+for fig in FIGURES:
+ asyfile = '%s.asy' % fig # static .asy file
+ env.Asymptote([asyfile, wtk_graph])
# Pass back the modified environment.
Return('env')
-
+++ /dev/null
-set terminal pdf font 'Times,7' size 9cm, 6cm
-set output 'fig.pdf'
-unset key
-set style data lines
-set xrange [-5:250]
-set yrange [-10:400]
-set ytics 0,100
-set xtics nomirror
-set ytics nomirror
-# border 3 = bottom & left
-set border 3
-set lmargin 9
-
-set multiplot
-
-set size 1,0.42;
-set origin 0.0,0.0;
-set xlabel 'Extension (nm)'
-plot 'fig1.d' using (($1-$2/0.05)*1e9):($2*1e12)
-
-set size 1,0.29;
-set origin 0.0,0.42;
-set bmargin 0
-unset xlabel
-set xtics format ""
-set ylabel 'Force (pN)'
-plot 'fig2.d' using (($1-$2/0.05)*1e9):($2*1e12)
-
-set origin 0.0,0.71;
-set bmargin 0
-set xtics format ""
-unset ylabel
-plot 'fig3.d' using (($1-$2/0.05)*1e9):($2*1e12)
-
-unset multiplot
--- /dev/null
+import wtk_graph;
+
+size(15cm,10cm,IgnoreAspect);
+
+scale(Linear, Linear);
+real k = 0.05; /* spring constant in N/m */
+real xscale=1e9;
+real fscale=1e12;
+
+void graphSawtooth(string file="datafile", real k,
+ int xcol=0, int fcol=1,
+ real xscale=1, real fscale=1, real dx=0, real df=0,
+ pen p=red) {
+ file fin=input(file).line();
+ real[][] a=fin.dimension(0,0);
+ a=transpose(a);
+ real[] x=a[xcol];
+ real[] f=a[fcol];
+ x = x - f/k; /* Remove cantilever extension */
+ graphData(x=x, y=f, xscale=xscale, yscale=fscale,
+ dx=dx, dy=df, p=p, dots=false);
+}
+
+graphSawtooth("fig1.dat", k=k, xscale=xscale, fscale=fscale, p=psoft);
+graphSawtooth("fig2.dat", k=k, xscale=xscale, fscale=fscale,
+ df=200e-12, p=pmed);
+graphSawtooth("fig3.dat", k=k, xscale=xscale, fscale=fscale,
+ df=400e-12, p=phard);
+
+//xlimits(xmin, xmax);
+//ylimits(ymin, ymax);
+xaxis(sLabel("Distance (nm)"), BottomTop, LeftTicks);
+yaxis(sLabel("Force (pN)"), LeftRight, RightTicks);
+/*
+set xrange [-5:250]
+set yrange [-10:400]
+set ytics 0,100
+
+set multiplot
+
+set size 1,0.42;
+set origin 0.0,0.0;
+set xlabel 'Extension (nm)'
+plot 'fig1.d' using (($1-$2/0.05)*1e9):($2*1e12)
+
+set size 1,0.29;
+set origin 0.0,0.42;
+set bmargin 0
+unset xlabel
+set xtics format ""
+set ylabel 'Force (pN)'
+plot 'fig2.d' using (($1-$2/0.05)*1e9):($2*1e12)
+
+set origin 0.0,0.71;
+set bmargin 0
+set xtics format ""
+unset ylabel
+plot 'fig3.d' using (($1-$2/0.05)*1e9):($2*1e12)
+*/
\begin{figure}
\vspace{-1in}
\begin{center}
-\subfloat[][]{\includegraphics{figures/sim-sawtooth/fig}\label{fig:sawsim:sim-sawtooth}%
+\subfloat[][]{\asyfig{figures/sim-sawtooth/sim-sawtooth}%
+ \label{fig:sawsim:sim-sawtooth}%
}\\
\subfloat[][]{\includegraphics{figures/sim-hist/fig}\label{fig:sawsim:sim-hist}%
}
connected through the N-C termini\citep{chyan04,carrion-vazquez03}.
Detachment from the tip or substrate is assumed to occur at a force
of $400\U{pN}$. In experiments, detachments have been observed to
- occur at a variety of forces. (b) The distribution of the unfolding
- forces from $400$ simulated force curves ($3200$ data points) such
- as that shown in (a). The frequency is normalized by the total
- number of points, \ie, the height of each bin is equal to the number
- of data points in that bin divided by the total number of data
- points ($3200$, for this histogram).\label{fig:sawsim:sim-all}}
+ occur at a variety of forces. For clarity, the green and blue
+ curves are offset by $200$ and $400\U{pN}$ respectively. (b) The
+ distribution of the unfolding forces from $400$ simulated force
+ curves ($3200$ data points) such as that shown in (a). The frequency
+ is normalized by the total number of points, \ie, the height of each
+ bin is equal to the number of data points in that bin divided by the
+ total number of data points ($3200$, for this
+ histogram).\label{fig:sawsim:sim-all}}
\end{center}
\end{figure}