ifdata[p] = ifd.getArrayData() if i==0: headers = ifdata[p].keys() shortheaders = [hj.replace(' > ','>').replace(' ','_') for hj in headers] pfmt[p] = {'color': colors[i], 'marker': None, 'linestyle': '-', 'label':p} ifd.clrArrayData() # Plot relevant data for j in xrange(0,len(headers)): hj = headers[j] hs = shortheaders[j] if hs!='time': plt.figure(1) fig = plt.gcf() cp = CustomPlot(fig) h = cp.splot(ifdata,'time',hj,pfmt) fig = cp.getfig() plt.legend(handles=h,bbox_to_anchor=(1.0,0.7),bbox_transform=plt.gcf().transFigure,prop={'size':10}) plt.xlabel('time (s)') if hj.find('mass')!=-1: yl = hj + ' ($M_\\odot$)' else: yl = hj plt.ylabel(yl) plt.title(hj + ' For ignMpoleA=' + impa + 'e5, pbIgnRho=10^7.2') plt.savefig(hs + '_mp-2' + suff.rstrip('_ordered.dat') + '.eps') plt.clf()
'color': colors[i], 'marker': None, 'linestyle': '-', 'label': p } ifd.clrArrayData() # Plot relevant data for j in xrange(0, len(headers)): hj = headers[j] hs = shortheaders[j] if hs != 'time': plt.figure(1) fig = plt.gcf() cp = CustomPlot(fig) h = cp.splot(ifdata, 'time', hj, pfmt) fig = cp.getfig() plt.legend(handles=h, bbox_to_anchor=(1.0, 0.7), bbox_transform=plt.gcf().transFigure, prop={'size': 10}) plt.xlabel('time (s)') if hj.find('mass') != -1: yl = hj + ' ($M_\\odot$)' else: yl = hj plt.ylabel(yl) plt.title(hj + ' For ignMpoleA=' + impa + 'e5, pbIgnRho=10^7.2') plt.savefig(hs + '_mp-2' + suff.rstrip('_ordered.dat') + '.eps') plt.clf()
os.chdir(this_dir) plot_order = co_r_keys + cone_r_keys + ['co_mean','cone_mean'] ifdata_po = OrderedDict((k,ifdata[k]) for k in plot_order) pfmt_po = OrderedDict((k,pfmt[k]) for k in plot_order) # Plot relevant data for j in xrange(0,len(headers)): hj = headers[j] hs = shortheaders[j] if hs!='time': print 'plotting: hj=' + str(hj) plt.figure(1) fig = plt.gcf() cp = CustomPlot(fig) h = cp.splot(ifdata_po,'time',hj,pfmt_po) fig = cp.getfig() handles_rzs = mlines.Line2D([],[],color='blue',alpha=0.75, linestyle='-',linewidth=2.0, label='CO WD Realizations') handles_rzm = mlines.Line2D([],[],color='orange',linestyle='-',linewidth=2.0, label='CO WD Mean Values') handles_cones = mlines.Line2D([],[],color='green',alpha=0.75, linestyle='-',linewidth=2.0, label='CONe WD Realizations') handles_conem = mlines.Line2D([],[],color='red',linestyle='-',linewidth=2.0, label='CONe WD Mean Values') h = [handles_rzs,handles_rzm,handles_cones,handles_conem] loc_legend_plots = {'E_internal':1, 'E_nuc' :1,
os.chdir(this_dir) plot_order = co_r_keys + cone_r_keys + ['co_mean', 'cone_mean'] ifdata_po = OrderedDict((k, ifdata[k]) for k in plot_order) pfmt_po = OrderedDict((k, pfmt[k]) for k in plot_order) # Plot relevant data for j in xrange(0, len(headers)): hj = headers[j] hs = shortheaders[j] if hs != 'time': print 'plotting: hj=' + str(hj) plt.figure(1) fig = plt.gcf() cp = CustomPlot(fig) h = cp.splot(ifdata_po, 'time', hj, pfmt_po) fig = cp.getfig() handles_rzs = mlines.Line2D([], [], color='blue', alpha=0.75, linestyle='-', linewidth=2.0, label='CO WD Realizations') handles_rzm = mlines.Line2D([], [], color='orange', linestyle='-', linewidth=2.0, label='CO WD Mean Values') handles_cones = mlines.Line2D([], [], color='green', alpha=0.75,