# Plot contours of equilibrium T execdir = os.path.dirname(sys.argv[0]) for col, Av, D in [ [myblue, 0.0, 0.2], [mygreen, 3.0, 0.2], [myred, 30.0, 0.2], [myblue, 0.0, 0.5], [mygreen, 3.0, 0.5], [myred, 30.0, 0.5], [myblue, 0.0, 2.0], [mygreen, 3.0, 2.0], [myred, 30.0, 2.0], ]: f = open(os.path.join(execdir, "hc-equilib-Av%.1f-D%.1f.dat" % (Av, D)), "r") dens, Teq = N.loadtxt(f, unpack=True) g.plot(data.values(x=N.log10(dens), y=N.log10(Teq)), [line([linestyle.solid, linewidth.thin, col])]) # Plot contours of cooling time cooltimes = [1.e2, 1.e3, 1.e4, 1.e5] from hctcool import cooling_time_years from contour import contour_rectgrid dgrid = N.linspace(nmin, nmax, num=200) # finer grid necessary to give smooth contours tgrid = N.linspace(tmin, tmax, num=200) tcgrid = cooling_time_years(*N.meshgrid(10**dgrid, 10**tgrid)) contours = contour_rectgrid(dgrid, tgrid, tcgrid, cooltimes) for i, contourset in enumerate(contours): for contour in contourset: g.plot(data.values(x=contour[0], y=contour[1]), [line([linestyle.dotted])]) gtitle = r'\texttt{%s}, $t = %.3f$~Myr' % (runid, age_Myr)
def testValues(self): mydata = data.values(a=[1, 4]) self.assertEqual(mydata.columns["a"], [1, 4]) self.assertEqual("c" in list(mydata.columns.keys()), 0)
text.set(cls=text.LatexRunner, texenc='utf-8') text.preamble(r'\usepackage[utf8]{inputenc}') text.preamble(r'\usepackage{textgreek}') text.preamble(r'\usepackage{fixltx2e}') text.preamble(r'\usepackage{libertine}') text.preamble(r'\renewcommand{\familydefault}{\sfdefault}') text.preamble(r'\usepackage{sansmath}') g = graph.graphxy( width=5.0, height=1.2, x=axis.linear(min=1, max=269, texter=texter.decimal(labelattrs=[text.clearmathmode]), title="TN residue"), y=axis.linear(min=0.0, parter=parter.linear(tickdists=[4.0, 2.0]), max=8.0, texter=texter.decimal(labelattrs=[text.clearmathmode]), title=r"RMSF ± std (Å)")) resid, rmsf_mean, rmsf_std = read_dat("rmsf.dat", [int, float, float]) g.plot(data.values(x=resid, y=rmsf_mean), [graph.style.line()]) ss = [line.strip() for line in open("ss.dat")] ssplot(g, ssdata(ss)) g.writePDFfile("graph")