import graph;
import palette;
+
real fsize=10;
Label sLabel(string s, align align=NoAlign, int extra_spaces=0) {
}
}
+void fitFile(picture pic=currentpicture, string file="fitparamfile",
+ int pcol=0, real f(real x, real[] params),
+ real xmin=realMin, real xmax=realMax,
+ real xscale=1, real yscale=1, pen p=red,
+ string t="Title") {
+ file fin=input(file).line();
+ real[][] a=fin.dimension(0,0);
+ a=transpose(a);
+ real[] params=a[pcol];
+ real fn(real x) {
+ return f(x / xscale, params) * yscale;
+ }
+ /* should be able to extract xmin and xmax from the figure...
+ if (xmin == realMin)
+ xmin = point(pic, W).x / xscale;
+ if (xmax == realMax)
+ xmax = point(pic, E).x / xscale;
+ */
+ if (t != "Title") {
+ draw(pic=pic, graph(pic, fn, a=xmin*xscale, b=xmax*xscale), p=p,
+ legend=sLabel(t,extra_spaces=1));
+ } else {
+ draw(pic=pic, graph(pic, fn, a=xmin*xscale, b=xmax*xscale), p=p);
+ }
+}
+
real[] identity_zfn(real[] z) {
return z;
}
+import os.path
+
+from site_cons.site_init import subdirs, link_wtk_graph
+
+
+FIGURES = ['v-dep', 'v-dep-sd']
+
# Get the passed in environment.
Import('env')
-for gp in Glob('*.gp'):
- env.Gnuplot(gp)
+data_dirs = [env.Dir(d) for d in subdirs(env, '*')]
+data_files = [env.File(os.path.join(str(d), 'v_dep'))
+ for d in data_dirs]
+
+pyfit = env.Alias('pyfit')
+# Extract the first source Node required to build the 'pyfit' Alias
+# (i.e. the File('pyfit') node).
+pyfit = pyfit[0].get_binfo().bsources[0]
+
+fit_files = []
+sd_fit_files = []
+for f in data_files:
+ fit = env.Command(
+ str(f)+'.fit',
+ [f, pyfit],
+ "python %s -m math:log -f 'A*log(x,10)+B' -v $SOURCE > $TARGET"
+ % str(pyfit))
+ fit_dat = env.Command(
+ str(fit[0])+'.dat',
+ fit,
+ "sed -n 's/^[A-Z]: //p' $SOURCE > $TARGET")
+ fit_files.append(fit_dat)
+ sd_fit = env.Command(
+ str(f)+'-sd.fit',
+ [f, pyfit],
+ "python %s -m math:log -f 'A*log(x,10)+B' -y 2 -v $SOURCE > $TARGET"
+ % str(pyfit))
+ sd_fit_dat = env.Command(
+ str(sd_fit[0])+'.dat',
+ sd_fit,
+ "sed -n 's/^[A-Z]: //p' $SOURCE > $TARGET")
+ sd_fit_files.append(sd_fit_dat)
+
+v_dep_data = data_files + fit_files
+v_dep_sd_data = data_files + sd_fit_files
+
+wtk_graph = link_wtk_graph(env)
+
+for fig in FIGURES:
+ asyfile = '%s.asy' % fig # static .asy file
+ pyfig = fig.replace('-', '_')
+ data = '%s_data' % (pyfig)
+ asydata = []
+ if data in globals(): # generated data dependencies
+ asydata = globals()[data]
+ env.Asymptote([asyfile, wtk_graph] + asydata)
# Pass back the modified environment.
Return('env')
+++ /dev/null
-set terminal pdf enhanced font 'Times,7' size 9cm, 6cm
-set output 'fig-sd.pdf'
-set xtics nomirror
-set ytics nomirror
-# border 3 = bottom & left
-set border 3
-set lmargin 9
-
-set multiplot
-
-set size 1.0,0.6
-set origin 0.0,0.0
-unset key
-set tmargin 0
-set style data linespoints
-set logscale x
-set xtics format "10^{%L}"
-set xlabel 'Pulling Speed (m/s)'
-set ylabel 'Standard Deviation (pN)'
-plot 'v_dep-5e-5_0.1e-9/v_dep' using ($1):($3*1e12) \
- title '{/Times-Italic k_{u0} = 5{\267}10^{-5}} s^{-1}, {/Times-Italic {/Symbol D}x_u=0.100} nm', \
- 'v_dep-1e-5_0.225e-9/v_dep' using ($1):($3*1e12) \
- title '{/Times-Italic k_{u0} = 1{\267}10^{-5}} s^{-1}, {/Times-Italic {/Symbol D}x_u=0.225} nm', \
- 'v_dep-5e-5_0.225e-9/v_dep' using ($1):($3*1e12) \
- title '{/Times-Italic k_{u0} = 5{\267}10^{-5}} s^{-1}, {/Times-Italic {/Symbol D}x_u=0.225} nm'
-
-set size 0.33,0.4
-unset key
-set tmargin -1
-set xrange [100:900]
-#set yrange [1e-4:1e-1]
-unset logscale x
-set logscale y
-set xtics 100,200
-set ytics format "10^{%L}"
-set xtics format "%g"
-set xlabel 'Force (pN)'
-set ylabel 'Frequency'
-set boxwidth 20
-set style data boxes
-set style fill solid 0.3
-#set style fill pattern 4
-
-# dummy plot to fix some sizing issue...
-set origin 1,1
-plot x
-
-set origin 0.0,0.6
-plot 'fig4i-5e-5_0.1e-9.hist' using ($1*1e12+10):($2/3200)
-
-set origin 0.33,0.6
-plot 'fig4i-1e-5_0.225e-9.hist' using ($1*1e12+10):($2/3200)
-
-set origin 0.67,0.6
-plot 'fig4i-5e-5_0.225e-9.hist' using ($1*1e12+10):($2/3200)
-
-unset multiplot
+++ /dev/null
-set terminal pdf enhanced font 'Times,7' size 9cm, 6cm
-set output 'fig.pdf'
-set xtics nomirror
-set ytics nomirror
-# border 3 = bottom & left
-set border 3
-
-set key left top
-set style data linespoints
-set logscale x
-set xtics format "10^{%L}"
-set xlabel 'Pulling Speed (m/s)'
-set ylabel 'Unfolding Force (pN)'
-plot 'v_dep-5e-5_0.1e-9/v_dep' using ($1):($2*1e12) \
- title '{/Times-Italic k_{u0} = 5{\267}10^{-5}} s^{-1}, {/Times-Italic {/Symbol D}x_u=0.100} nm', \
- 'v_dep-1e-5_0.225e-9/v_dep' using ($1):($2*1e12) \
- title '{/Times-Italic k_{u0} = 1{\267}10^{-5}} s^{-1}, {/Times-Italic {/Symbol D}x_u=0.225} nm', \
- 'v_dep-5e-5_0.225e-9/v_dep' using ($1):($2*1e12) \
- title '{/Times-Italic k_{u0} = 5{\267}10^{-5}} s^{-1}, {/Times-Italic {/Symbol D}x_u=0.225} nm'
--- /dev/null
+import wtk_graph;
+
+size(15cm,10cm,IgnoreAspect);
+
+scale(Log, Linear);
+real xscale=1e9;
+real yscale=1e12;
+
+/* f(x) = A + log10(x) + B */
+real fn_logxliny(real x, real[] params) {
+ return params[0] * log10(x) + params[1];
+}
+
+graphFile("v_dep-5e-5_0.1e-9/v_dep", ycol=2, xscale=xscale, yscale=yscale,
+ p=psoft,
+ t="$k_{u0}=5\E{-5}\U{s$^-1$}, \Delta x_u=0.100\U{nm}", dots=true);
+graphFile("v_dep-1e-5_0.225e-9/v_dep", ycol=2, xscale=xscale, yscale=yscale,
+ p=pmed,
+ t="$k_{u0}=1\E{-5}\U{s$^-1$}, \Delta x_u=0.225\U{nm}", dots=true);
+graphFile("v_dep-5e-5_0.225e-9/v_dep", ycol=2, xscale=xscale, yscale=yscale,
+ p=phard,
+ t="$k_{u0}=5\E{-5}\U{s$^-1$}, \Delta x_u=0.225\U{nm}", dots=true);
+fitFile("v_dep-5e-5_0.1e-9/v_dep-sd.fit.dat", f=fn_logxliny,
+ xmin=1e-9, xmax=1e-5, xscale=xscale, yscale=yscale, p=psoft);
+fitFile("v_dep-1e-5_0.225e-9/v_dep-sd.fit.dat", f=fn_logxliny,
+ xmin=1e-9, xmax=1e-5, xscale=xscale, yscale=yscale, p=pmed);
+fitFile("v_dep-5e-5_0.225e-9/v_dep-sd.fit.dat", f=fn_logxliny,
+ xmin=1e-9, xmax=1e-5, xscale=xscale, yscale=yscale, p=phard);
+
+label(sLabel("Pulling speed dependence"), point(N),N);
+xaxis(sLabel("Pulling speed (nm/s)"),BottomTop,LeftTicks);
+yaxis(sLabel("Unfolding force (pN)"),LeftRight,RightTicks);
+/*
+set size 0.33,0.4
+unset key
+set tmargin -1
+set xrange [100:900]
+#set yrange [1e-4:1e-1]
+unset logscale x
+set logscale y
+set xtics 100,200
+set ytics format "10^{%L}"
+set xtics format "%g"
+set xlabel 'Force (pN)'
+set ylabel 'Frequency'
+set boxwidth 20
+set style data boxes
+set style fill solid 0.3
+#set style fill pattern 4
+
+# dummy plot to fix some sizing issue...
+set origin 1,1
+plot x
+
+set origin 0.0,0.6
+plot 'fig4i-5e-5_0.1e-9.hist' using ($1*1e12+10):($2/3200)
+
+set origin 0.33,0.6
+plot 'fig4i-1e-5_0.225e-9.hist' using ($1*1e12+10):($2/3200)
+
+set origin 0.67,0.6
+plot 'fig4i-5e-5_0.225e-9.hist' using ($1*1e12+10):($2/3200)
+
+unset multiplot
+*/
--- /dev/null
+import wtk_graph;
+
+size(15cm,10cm,IgnoreAspect);
+
+scale(Log, Linear);
+real xscale=1e9;
+real yscale=1e12;
+
+/* f(x) = A + log10(x) + B */
+real fn_logxliny(real x, real[] params) {
+ return params[0] * log10(x) + params[1];
+}
+
+graphFile("v_dep-5e-5_0.1e-9/v_dep", xscale=xscale, yscale=yscale, p=psoft,
+ t="$k_{u0}=5\E{-5}\U{s$^-1$}, \Delta x_u=0.100\U{nm}", dots=true);
+graphFile("v_dep-1e-5_0.225e-9/v_dep", xscale=xscale, yscale=yscale, p=pmed,
+ t="$k_{u0}=1\E{-5}\U{s$^-1$}, \Delta x_u=0.225\U{nm}", dots=true);
+graphFile("v_dep-5e-5_0.225e-9/v_dep", xscale=xscale, yscale=yscale, p=phard,
+ t="$k_{u0}=5\E{-5}\U{s$^-1$}, \Delta x_u=0.225\U{nm}", dots=true);
+fitFile("v_dep-5e-5_0.1e-9/v_dep.fit.dat", f=fn_logxliny,
+ xmin=1e-9, xmax=1e-5, xscale=xscale, yscale=yscale, p=psoft);
+fitFile("v_dep-1e-5_0.225e-9/v_dep.fit.dat", f=fn_logxliny,
+ xmin=1e-9, xmax=1e-5, xscale=xscale, yscale=yscale, p=pmed);
+fitFile("v_dep-5e-5_0.225e-9/v_dep.fit.dat", f=fn_logxliny,
+ xmin=1e-9, xmax=1e-5, xscale=xscale, yscale=yscale, p=phard);
+
+label(sLabel("Pulling speed dependence"), point(N), N);
+xaxis(sLabel("Pulling speed (nm/s)"), BottomTop, LeftTicks);
+yaxis(sLabel("Unfolding force (pN)"), LeftRight, RightTicks);
\begin{figure}
\begin{center}
- \subfloat[][]{\includegraphics{figures/v-dep/fig}%
+ \subfloat[][]{\asyfig{figures/v-dep/v-dep}%
\label{fig:sawsim:v-dep}%
} \\
- \subfloat[][]{\includegraphics{figures/v-dep/fig-sd}%
+ \subfloat[][]{\asyfig{figures/v-dep/v-dep-sd}%
\label{fig:sawsim:width-v-dep}%
}
\caption{(a) The dependence of the unfolding forces on the pulling