def plotdeltaphase(fname, k): d = genplotlib.gendict_phase(fname, 'deltaphase') print(d) plt.figure() genplotlib.plot_phaseplot(d, k, 'no', 'Phase') plt.savefig('deltaphase_r1')
def plotdeltatime(fname, k): d = genplotlib.gendict_phase(fname, 'deltatime') md = genplotlib.genlist(d) n = [] for i, v in d.iteritems(): n.append(max(v)) print(n) plt.figure() genplotlib.plotdata(d, md, k, 's', 'Delay (seconds)', 'Time delay', ymin=0.05, ylim=(max(n) + 0.1 * max(n))) plt.savefig('deltatime_summ') plt.figure() genplotlib.plotdata(d, md, k, 'b', 'Delay (seconds)', 'Time delay', ymin=0.05, ylim=(max(n) + 0.1 * max(n))) plt.savefig('deltatime_summ_bar')
def plotdeltaframe(fname, k): d = genplotlib.gendict_phase(fname, 'deltaframe') md = genplotlib.genlist(d) n = [] for i, v in d.iteritems(): n.append(max(v)) print(n) plt.figure() genplotlib.plotdata(d, md, k, 's', 'Delay (frames)', 'Frame delay', ymin=0, ylim=max(n) + 5) plt.savefig('deltaframe_summ') plt.figure() genplotlib.plotdata(d, md, k, 'b', 'Delay (frames)', 'Frame delay', ymin=0, ylim=max(n) + 5) plt.savefig('deltaframe_summ_bar')
def plotphaselen(fname, K): """Plots and saves the phase vs. length of phase vector; run from the 'summary' folder.""" d = genplotlib.gendict_phase(fname, 'dp_freq') plt.figure() ad = genavgphaselendict(d) print(ad) genplotlib.plot_phaseplot_l(ad, K, 'no', 'Average phase', withn='no') aname = 'deltaphasevsphaselen_avg' plt.savefig(aname)
def plotphasenlpersec(fname, K): """Plots and saves the phase vs. nlpersec plots; run from the 'summary' folder.""" d = genplotlib.gendict_phase(fname, 'dp_freq') plt.figure() genplotlib.plot_phaseplot_lpf(d, K, 'no', 'Phase vs. volume drunk') pname = 'deltaphasevsvol' plt.savefig(pname) plt.figure() ad = genavgphasefreqdict(d) print(ad) genplotlib.plot_phaseplot_lpf(ad, K, 'no', 'Average phase vs. average volume', withn='no') aname = 'deltaphasevsfreq_avg' plt.savefig(aname)
def plotdeltaframe(fname, k): d = genplotlib.gendict_phase(fname, 'deltaframe') md = genplotlib.genlist(d) n = [] for i, v in d.iteritems(): n.append(max(v)) print(n) plt.figure() genplotlib.plotdata(d, md, k, 's', 'Delay (frames)', 'Frame delay', ymin=0, ylim=max(n)+5) plt.savefig('deltaframe_summ') plt.figure() genplotlib.plotdata(d, md, k, 'b', 'Delay (frames)', 'Frame delay', ymin=0, ylim=max(n)+5) plt.savefig('deltaframe_summ_bar')
def plotdeltatime(fname, k): d = genplotlib.gendict_phase(fname, 'deltatime') md = genplotlib.genlist(d) n = [] for i, v in d.iteritems(): n.append(max(v)) print(n) plt.figure() genplotlib.plotdata(d, md, k, 's', 'Delay (seconds)', 'Time delay', ymin=0.05, ylim=(max(n)+0.1*max(n))) plt.savefig('deltatime_summ') plt.figure() genplotlib.plotdata(d, md, k, 'b', 'Delay (seconds)', 'Time delay', ymin=0.05, ylim=(max(n)+0.1*max(n))) plt.savefig('deltatime_summ_bar')
"""Plots bar graph from data in 'peakf.txt' and saves it in the summary directory. Run from a data/ or summary/ folder.""" dictmeans = genplotlib.genlist(dictdata) n = [] for i, v in dictdata.iteritems(): n.append(max(v)) plt.figure() genplotlib.plotdata(d, md, k, 'b', 'Delay (seconds)', 'Time delay', ymin=0.05, ylim=(max(n))) plt.savefig(plotname) print(os.path.abspath(os.getcwd())) k = load_keys(keyfile) d = genplotlib.gendict_phase(fname, 'deltatime') print(d) md = genplotlib.genlist(d) print(md) writemeans(md, meansfname) plotbar(d, k, plotname)
def writemeans_deltatime(fnameread, fnamewrite): d = gpl.gendict_phase(fnameread, 'deltatime') md = gpl.genlist(d) writemeans(md, fnamewrite)
fname = sys.argv[1] keyfile = sys.argv[2] plotname = sys.argv[3] meansfname = sys.argv[4] def plotbar(dictdata, keylist, plotname, fdir='.', ylim=10): """Plots bar graph from data in 'peakf.txt' and saves it in the summary directory. Run from a data/ or summary/ folder.""" dictmeans = genplotlib.genlist(dictdata) n = [] for i, v in dictdata.iteritems(): n.append(max(v)) plt.figure() genplotlib.plotdata(d, md, k, 'b', 'Delay (seconds)', 'Time delay', ymin=0.05, ylim=(max(n))) plt.savefig(plotname) print(os.path.abspath(os.getcwd())) k = load_keys(keyfile) d = genplotlib.gendict_phase(fname, 'deltatime') print(d) md = genplotlib.genlist(d) print(md) writemeans(md, meansfname) plotbar(d, k, plotname)