def abu_flux_chart(self, cycle, ilabel=True, imlabel=True,<EOL>imagic=False, boxstable=True, lbound=(-<NUM_LIT:12>,<NUM_LIT:0>),<EOL>plotaxis=[<NUM_LIT:0>,<NUM_LIT:0>,<NUM_LIT:0>,<NUM_LIT:0>], which_flux=None, prange=None,<EOL>profile='<STR_LIT>', show=True):
<EOL>mass_range = None<EOL>if str(cycle.__class__)=="<STR_LIT>":<EOL><INDENT>self.abu_chartMulti(cycle, mass_range,ilabel,imlabel,imlabel_fontsize,imagic,boxstable,lbound,plotaxis)<EOL>return<EOL><DEDENT>plotType=self._classTest()<EOL>if plotType=='<STR_LIT>':<EOL><INDENT>cycle=self.se.findCycle(cycle)<EOL>nin=zeros(len(self.se.A))<EOL>zin=zeros(len(self.se.Z))<EOL>for i in range(len(nin)):<EOL><INDENT>nin[i]=self.se.A[i]<EOL>zin[i]=self.se.Z[i]<EOL><DEDENT>for i in range(len(nin)):<EOL><INDENT>nin[i]=nin[i]-zin[i]<EOL><DEDENT>yin=self.get(cycle, '<STR_LIT>')<EOL>isom=self.se.isomeric_states<EOL>masses = self.se.get(cycle,'<STR_LIT>')<EOL>if mass_range != None:<EOL><INDENT>masses = self.se.get(cycle,'<STR_LIT>')<EOL>masses.sort()<EOL><DEDENT>if mass_range != None:<EOL><INDENT>tmpyps=[]<EOL>masses = self.se.get(cycle,'<STR_LIT>')<EOL>masses = self.se.get(cycle,'<STR_LIT>')<EOL>masses.sort()<EOL>for i in range(len(masses)):<EOL><INDENT>if (masses[i] >mass_range[<NUM_LIT:0>] and masses[i]<mass_range[<NUM_LIT:1>]) or(masses[i]==mass_range[<NUM_LIT:0>] or masses[i]==mass_range[<NUM_LIT:1>]):<EOL><INDENT>tmpyps.append(yin[i])<EOL><DEDENT><DEDENT>yin=tmpyps<EOL><DEDENT>tmp=zeros(len(yin[<NUM_LIT:0>]))<EOL>for i in range(len(yin)):<EOL><INDENT>for j in range(len(yin[i])):<EOL><INDENT>tmp[j]+=yin[i][j]<EOL><DEDENT><DEDENT>tmp=old_div(tmp,len(yin))<EOL>yin=tmp<EOL><DEDENT>elif plotType=='<STR_LIT>':<EOL><INDENT>ain=self.get('<STR_LIT:A>',cycle)<EOL>zin=self.get('<STR_LIT>',cycle)<EOL>nin=ain-zin<EOL>yin=self.get('<STR_LIT>',cycle)<EOL>isom=self.get('<STR_LIT>',cycle)<EOL>if mass_range != None:<EOL><INDENT>tmpA=[]<EOL>tmpZ=[]<EOL>tmpIsom=[]<EOL>tmpyps=[]<EOL>for i in range(len(nin)):<EOL><INDENT>if (ain[i] >mass_range[<NUM_LIT:0>] and ain[i]<mass_range[<NUM_LIT:1>])or (ain[i]==mass_range[<NUM_LIT:0>] or ain[i]==mass_range[<NUM_LIT:1>]):<EOL><INDENT>tmpA.append(nin[i])<EOL>tmpZ.append(zin[i])<EOL>tmpIsom.append(isom[i])<EOL>tmpyps.append(yin[i])<EOL><DEDENT><DEDENT>zin=tmpZ<EOL>nin=tmpA<EOL>yin=tmpyps<EOL>isom=tmpIsom<EOL><DEDENT><DEDENT>else:<EOL><INDENT>print('<STR_LIT>')<EOL>print('<STR_LIT>')<EOL>return None<EOL><DEDENT>turnoff=False<EOL>if not show:<EOL><INDENT>try:<EOL><INDENT>ioff()<EOL>turnoff=True<EOL><DEDENT>except NameError:<EOL><INDENT>turnoff=False<EOL><DEDENT><DEDENT>nnmax = int(max(nin))+<NUM_LIT:1><EOL>nzmax = int(max(zin))+<NUM_LIT:1><EOL>nnmax_plot = nnmax<EOL>nzmax_plot = nzmax<EOL>nzycheck = zeros([nnmax,nzmax,<NUM_LIT:3>])<EOL>nzycheck_plot = zeros([nnmax,nzmax,<NUM_LIT:3>])<EOL>for i in range(len(nin)):<EOL><INDENT>if isom[i]==<NUM_LIT:1>:<EOL><INDENT>ni = int(nin[i])<EOL>zi = int(zin[i])<EOL>nzycheck[ni,zi,<NUM_LIT:0>] = <NUM_LIT:1><EOL>nzycheck[ni,zi,<NUM_LIT:1>] = yin[i]<EOL>nzycheck_plot[ni,zi,<NUM_LIT:0>] = <NUM_LIT:1><EOL><DEDENT><DEDENT>elname=self.elements_names<EOL>if plotaxis==[<NUM_LIT:0>,<NUM_LIT:0>,<NUM_LIT:0>,<NUM_LIT:0>]:<EOL><INDENT>xdim=<NUM_LIT:10><EOL>ydim=<NUM_LIT:6><EOL><DEDENT>else:<EOL><INDENT>dx = plotaxis[<NUM_LIT:1>]-plotaxis[<NUM_LIT:0>]<EOL>dy = plotaxis[<NUM_LIT:3>]-plotaxis[<NUM_LIT:2>]<EOL>ydim = <NUM_LIT:6><EOL>xdim = ydim*dx/dy<EOL><DEDENT>params = {'<STR_LIT>':  <NUM_LIT:15>,<EOL>'<STR_LIT>':   <NUM_LIT:12>,<EOL>'<STR_LIT>': <NUM_LIT:15>,<EOL>'<STR_LIT>': <NUM_LIT:15>,<EOL>'<STR_LIT>': <NUM_LIT:15>,<EOL>'<STR_LIT>': True}<EOL>fig=pl.figure()<EOL>if profile == '<STR_LIT>':<EOL><INDENT>ax1 = fig.add_subplot(<NUM_LIT:1>, <NUM_LIT:2>, <NUM_LIT:1>)<EOL><DEDENT>elif profile == '<STR_LIT>':<EOL><INDENT>ax1 = fig.add_subplot(<NUM_LIT:2>, <NUM_LIT:1>, <NUM_LIT:1>)<EOL><DEDENT>xminorlocator = MultipleLocator(<NUM_LIT:1>)<EOL>xmajorlocator = MultipleLocator(<NUM_LIT:5>)<EOL>ax1.xaxis.set_major_locator(xmajorlocator)<EOL>ax1.xaxis.set_minor_locator(xminorlocator)<EOL>yminorlocator = MultipleLocator(<NUM_LIT:1>)<EOL>ymajorlocator = MultipleLocator(<NUM_LIT:5>)<EOL>ax1.yaxis.set_major_locator(ymajorlocator)<EOL>ax1.yaxis.set_minor_locator(yminorlocator)<EOL>cmapa = cm.summer<EOL>cmapr = cm.summer<EOL>cmapa.set_under(color='<STR_LIT:w>')<EOL>cmapr.set_under(color='<STR_LIT:w>')<EOL>norma = colors.Normalize(vmin=lbound[<NUM_LIT:0>],vmax=lbound[<NUM_LIT:1>])<EOL>temp = '<STR_LIT:U+0020>'<EOL>time = '<STR_LIT:U+0020>'<EOL>dens = '<STR_LIT:U+0020>'<EOL>'''<STR_LIT>'''<EOL>patches = []<EOL>color = []<EOL>for i in range(nzmax):<EOL><INDENT>for j in range(nnmax):<EOL><INDENT>if nzycheck[j,i,<NUM_LIT:0>]==<NUM_LIT:1>:<EOL><INDENT>xy = j-<NUM_LIT:0.5>,i-<NUM_LIT:0.5><EOL>rect = Rectangle(xy,<NUM_LIT:1>,<NUM_LIT:1>,)<EOL>yab = nzycheck[j,i,<NUM_LIT:1>]<EOL>if yab == <NUM_LIT:0>:<EOL><INDENT>yab=<NUM_LIT><EOL><DEDENT>col =log10(yab)<EOL>patches.append(rect)<EOL>color.append(col)<EOL><DEDENT><DEDENT><DEDENT>p = PatchCollection(patches, cmap=cmapa, norm=norma)<EOL>p.set_array(array(color))<EOL>p.set_zorder(<NUM_LIT:1>)<EOL>ax1.add_collection(p)<EOL>cb = pl.colorbar(p)<EOL>if profile == '<STR_LIT>':<EOL><INDENT>cb.set_label('<STR_LIT>')<EOL><DEDENT>graphname = '<STR_LIT>'+str(cycle)<EOL>if boxstable:<EOL><INDENT>for i in range(len(self.stable_el)):<EOL><INDENT>if i == <NUM_LIT:0>:<EOL><INDENT>continue<EOL><DEDENT>tmp = self.stable_el[i]<EOL>try:<EOL><INDENT>zz= self.elements_names.index(tmp[<NUM_LIT:0>]) <EOL><DEDENT>except:<EOL><INDENT>continue<EOL><DEDENT>for j in range(len(tmp)):<EOL><INDENT>if j == <NUM_LIT:0>:<EOL><INDENT>continue<EOL><DEDENT>nn = int(tmp[j]) <EOL>nn=nn-zz<EOL>xy = nn-<NUM_LIT:0.5>,zz-<NUM_LIT:0.5><EOL>rect = Rectangle(xy,<NUM_LIT:1>,<NUM_LIT:1>,ec='<STR_LIT:k>',fc='<STR_LIT:None>',fill='<STR_LIT:False>',lw=<NUM_LIT>)<EOL>rect.set_zorder(<NUM_LIT:2>)<EOL>ax1.add_patch(rect)<EOL><DEDENT><DEDENT><DEDENT>iarr = <NUM_LIT:0><EOL>if ilabel:<EOL><INDENT>for z in range(nzmax):<EOL><INDENT>try:<EOL><INDENT>nmin = min(argwhere(nzycheck[:,z,iarr]))[<NUM_LIT:0>]-<NUM_LIT:1><EOL>nmax = max(argwhere(nzycheck[:,z,iarr]))[<NUM_LIT:0>]+<NUM_LIT:1><EOL>ax1.text(nmin,z,elname[z],horizontalalignment='<STR_LIT>',verticalalignment='<STR_LIT>',fontsize='<STR_LIT>',clip_on=True)<EOL>ax1.text(nmax,z,elname[z],horizontalalignment='<STR_LIT>',verticalalignment='<STR_LIT>',fontsize='<STR_LIT>',clip_on=True)<EOL><DEDENT>except ValueError:<EOL><INDENT>continue<EOL><DEDENT><DEDENT><DEDENT>if imlabel:<EOL><INDENT>for z in range(nzmax):<EOL><INDENT>for n in range(nnmax):<EOL><INDENT>a = z+n<EOL>if nzycheck[n,z,iarr]==<NUM_LIT:1>:<EOL><INDENT>ax1.text(n,z,a,horizontalalignment='<STR_LIT>',verticalalignment='<STR_LIT>',fontsize='<STR_LIT>',clip_on=True)<EOL><DEDENT><DEDENT><DEDENT><DEDENT>if imagic:<EOL><INDENT>ixymagic=[<NUM_LIT:2>, <NUM_LIT:8>, <NUM_LIT:20>, <NUM_LIT>, <NUM_LIT:50>, <NUM_LIT>, <NUM_LIT>]<EOL>nmagic = len(ixymagic)<EOL>for magic in ixymagic:<EOL><INDENT>if magic<=nzmax:<EOL><INDENT>try:<EOL><INDENT>xnmin = min(argwhere(nzycheck[:,magic,iarr]))[<NUM_LIT:0>]<EOL>xnmax = max(argwhere(nzycheck[:,magic,iarr]))[<NUM_LIT:0>]<EOL>line = ax1.plot([xnmin,xnmax],[magic,magic],lw=<NUM_LIT>,color='<STR_LIT:r>',ls='<STR_LIT:->')<EOL><DEDENT>except ValueError:<EOL><INDENT>dummy=<NUM_LIT:0><EOL><DEDENT><DEDENT>if magic<=nnmax:<EOL><INDENT>try:<EOL><INDENT>yzmin = min(argwhere(nzycheck[magic,:,iarr]))[<NUM_LIT:0>]<EOL>yzmax = max(argwhere(nzycheck[magic,:,iarr]))[<NUM_LIT:0>]<EOL>line = ax1.plot([magic,magic],[yzmin,yzmax],lw=<NUM_LIT>,color='<STR_LIT:r>',ls='<STR_LIT:->')<EOL><DEDENT>except ValueError:<EOL><INDENT>dummy=<NUM_LIT:0><EOL><DEDENT><DEDENT><DEDENT><DEDENT>if plotaxis==[<NUM_LIT:0>,<NUM_LIT:0>,<NUM_LIT:0>,<NUM_LIT:0>]:<EOL><INDENT>xmax=max(nin)<EOL>ymax=max(zin)<EOL>ax1.axis([-<NUM_LIT:0.5>,xmax+<NUM_LIT:0.5>,-<NUM_LIT:0.5>,ymax+<NUM_LIT:0.5>])<EOL><DEDENT>else:<EOL><INDENT>ax1.axis(plotaxis)<EOL><DEDENT>ax1.set_ylabel('<STR_LIT>')<EOL>if profile == '<STR_LIT>':<EOL><INDENT>ax1.set_xlabel('<STR_LIT>')<EOL><DEDENT>file_name = '<STR_LIT>'+str(cycle).zfill(<NUM_LIT:5>)+'<STR_LIT>'<EOL>print(file_name)<EOL>f = open(file_name)<EOL>lines = f.readline()<EOL>lines = f.readlines()<EOL>f.close()<EOL>print_max_flux_in_plot =  False<EOL>cmapa = cm.autumn<EOL>cmapr = cm.autumn<EOL>coord_x_1 = []<EOL>coord_y_1 = []<EOL>coord_x_2 = []<EOL>coord_y_2 = []<EOL>coord_x_3 = []<EOL>coord_y_3 = []<EOL>flux_read = []<EOL>flux_log10 = []<EOL>if which_flux == None or which_flux == <NUM_LIT:0>:<EOL><INDENT>print('<STR_LIT>')<EOL>line_to_read = <NUM_LIT:9><EOL><DEDENT>elif which_flux == <NUM_LIT:1>:<EOL><INDENT>print('<STR_LIT>')<EOL>line_to_read = <NUM_LIT:10><EOL><DEDENT>elif which_flux > <NUM_LIT:1>:<EOL><INDENT>print("<STR_LIT>")<EOL><DEDENT>single_line = []<EOL>for i in range(len(lines)):<EOL><INDENT>single_line.append(lines[i].split())<EOL>coord_y_1.append(int(single_line[i][<NUM_LIT:1>]))<EOL>coord_x_1.append(int(single_line[i][<NUM_LIT:2>])-coord_y_1[i])<EOL>coord_y_2.append(int(single_line[i][<NUM_LIT:5>]))<EOL>coord_x_2.append(int(single_line[i][<NUM_LIT:6>])-coord_y_2[i])<EOL>coord_y_3.append(int(single_line[i][<NUM_LIT:7>]))<EOL>coord_x_3.append(int(single_line[i][<NUM_LIT:8>])-coord_y_3[i])<EOL>try:<EOL><INDENT>flux_read.append(float(single_line[i][line_to_read]))<EOL><DEDENT>except ValueError: <EOL><INDENT>flux_read.append(<NUM_LIT>)<EOL><DEDENT>flux_log10.append(log10(flux_read[i]+<NUM_LIT>))<EOL><DEDENT>print(file_name,'<STR_LIT>')<EOL>if plotaxis!=[<NUM_LIT:0>,<NUM_LIT:0>,<NUM_LIT:0>,<NUM_LIT:0>]:<EOL><INDENT>coord_y_1_small=[]<EOL>coord_x_1_small=[]<EOL>coord_y_2_small=[]<EOL>coord_x_2_small=[]<EOL>coord_y_3_small=[]<EOL>coord_x_3_small=[]<EOL>flux_log10_small = []<EOL>for i in range(len(flux_log10)):<EOL><INDENT>I_am_in = <NUM_LIT:0><EOL>if coord_y_1[i] > plotaxis[<NUM_LIT:2>] and coord_y_1[i] < plotaxis[<NUM_LIT:3>] and coord_x_1[i] > plotaxis[<NUM_LIT:0>] and coord_x_1[i] < plotaxis[<NUM_LIT:1>]:<EOL><INDENT>I_am_in = <NUM_LIT:1><EOL>coord_y_1_small.append(int(coord_y_1[i]))<EOL>coord_x_1_small.append(int(coord_x_1[i]))<EOL>coord_y_2_small.append(int(coord_y_2[i]))<EOL>coord_x_2_small.append(int(coord_x_2[i]))<EOL>coord_y_3_small.append(int(coord_y_3[i]))<EOL>coord_x_3_small.append(int(coord_x_3[i]))<EOL>flux_log10_small.append(flux_log10[i])<EOL><DEDENT>if coord_y_3[i] > plotaxis[<NUM_LIT:2>] and coord_y_3[i] < plotaxis[<NUM_LIT:3>] and coord_x_3[i] > plotaxis[<NUM_LIT:0>] and coord_x_3[i] < plotaxis[<NUM_LIT:1>] and I_am_in == <NUM_LIT:0>:<EOL><INDENT>I_am_in = <NUM_LIT:1><EOL>coord_y_1_small.append(int(coord_y_1[i]))<EOL>coord_x_1_small.append(int(coord_x_1[i]))<EOL>coord_y_2_small.append(int(coord_y_2[i]))<EOL>coord_x_2_small.append(int(coord_x_2[i]))<EOL>coord_y_3_small.append(int(coord_y_3[i]))<EOL>coord_x_3_small.append(int(coord_x_3[i]))<EOL>flux_log10_small.append(flux_log10[i])<EOL><DEDENT><DEDENT><DEDENT>ilabel = <NUM_LIT:1><EOL>imlabel = <NUM_LIT:1><EOL>imagic = <NUM_LIT:0><EOL>if prange == None:<EOL><INDENT>print('<STR_LIT>')<EOL>prange = <NUM_LIT><EOL><DEDENT>max_flux = max(flux_log10)<EOL>ind_max_flux = flux_log10.index(max_flux)<EOL>if plotaxis!=[<NUM_LIT:0>,<NUM_LIT:0>,<NUM_LIT:0>,<NUM_LIT:0>]:<EOL><INDENT>max_flux_small = max(flux_log10_small)<EOL><DEDENT>if plotaxis==[<NUM_LIT:0>,<NUM_LIT:0>,<NUM_LIT:0>,<NUM_LIT:0>]:<EOL><INDENT>nzmax = int(max(max(coord_y_1),max(coord_y_2),max(coord_y_3)))+<NUM_LIT:1><EOL>nnmax = int(max(max(coord_x_1),max(coord_x_2),max(coord_x_3)))+<NUM_LIT:1><EOL>coord_x_1_small = coord_x_1<EOL>coord_x_2_small = coord_x_2<EOL>coord_x_3_small = coord_x_3<EOL>coord_y_1_small = coord_y_1<EOL>coord_y_2_small = coord_y_2<EOL>coord_y_3_small = coord_y_3<EOL>flux_log10_small= flux_log10<EOL>max_flux_small  = max_flux<EOL><DEDENT>else:<EOL><INDENT>nzmax = int(max(max(coord_y_1_small),max(coord_y_2_small),max(coord_y_3_small)))+<NUM_LIT:1><EOL>nnmax = int(max(max(coord_x_1_small),max(coord_x_2_small),max(coord_x_3_small)))+<NUM_LIT:1><EOL><DEDENT>for i in range(nzmax):<EOL><INDENT>for j in range(nnmax):<EOL><INDENT>if nzycheck[j,i,<NUM_LIT:0>]==<NUM_LIT:1>:<EOL><INDENT>xy = j-<NUM_LIT:0.5>,i-<NUM_LIT:0.5><EOL>rect = Rectangle(xy,<NUM_LIT:1>,<NUM_LIT:1>,)<EOL>patches.append(rect)<EOL><DEDENT><DEDENT><DEDENT>nzycheck = zeros([nnmax_plot,nzmax,<NUM_LIT:3>])<EOL>coord_x_out = zeros(len(coord_x_2_small), dtype='<STR_LIT:int>')<EOL>coord_y_out = zeros(len(coord_y_2_small),dtype='<STR_LIT:int>')<EOL>for i in range(len(flux_log10_small)):<EOL><INDENT>nzycheck[coord_x_1_small[i],coord_y_1_small[i],<NUM_LIT:0>] = <NUM_LIT:1><EOL>nzycheck[coord_x_1_small[i],coord_y_1_small[i],<NUM_LIT:1>] = flux_log10_small[i]<EOL>if coord_x_2_small[i] >= coord_x_3_small[i]:<EOL><INDENT>coord_x_out[i] = coord_x_2_small[i]<EOL>coord_y_out[i] = coord_y_2_small[i]<EOL>nzycheck[coord_x_out[i],coord_y_out[i],<NUM_LIT:0>] = <NUM_LIT:1><EOL>nzycheck[coord_x_out[i],coord_y_out[i],<NUM_LIT:1>] = flux_log10_small[i]<EOL><DEDENT>elif coord_x_2_small[i] < coord_x_3_small[i]:<EOL><INDENT>coord_x_out[i] = coord_x_3_small[i]<EOL>coord_y_out[i] = coord_y_3_small[i]<EOL>nzycheck[coord_x_out[i],coord_y_out[i],<NUM_LIT:0>] = <NUM_LIT:1><EOL>nzycheck[coord_x_out[i],coord_y_out[i],<NUM_LIT:1>] = flux_log10_small[i]<EOL><DEDENT>if flux_log10_small[i]>max_flux_small-prange:<EOL><INDENT>nzycheck[coord_x_1_small[i],coord_y_1_small[i],<NUM_LIT:2>] = <NUM_LIT:1><EOL>nzycheck[coord_x_out[i],coord_y_out[i],<NUM_LIT:2>] = <NUM_LIT:1><EOL><DEDENT><DEDENT>if profile == '<STR_LIT>':<EOL><INDENT>ax2 = fig.add_subplot(<NUM_LIT:1>, <NUM_LIT:2>, <NUM_LIT:2>)<EOL><DEDENT>elif profile == '<STR_LIT>':<EOL><INDENT>ax2 = fig.add_subplot(<NUM_LIT:2>, <NUM_LIT:1>, <NUM_LIT:2>)<EOL><DEDENT>xminorlocator = MultipleLocator(<NUM_LIT:1>)<EOL>xmajorlocator = MultipleLocator(<NUM_LIT:5>)<EOL>ax2.xaxis.set_major_locator(xmajorlocator)<EOL>ax2.xaxis.set_minor_locator(xminorlocator)<EOL>yminorlocator = MultipleLocator(<NUM_LIT:1>)<EOL>ymajorlocator = MultipleLocator(<NUM_LIT:5>)<EOL>ax2.yaxis.set_major_locator(ymajorlocator)<EOL>ax2.yaxis.set_minor_locator(yminorlocator)<EOL>if plotaxis==[<NUM_LIT:0>,<NUM_LIT:0>,<NUM_LIT:0>,<NUM_LIT:0>]:<EOL><INDENT>xdim=<NUM_LIT:10><EOL>ydim=<NUM_LIT:6><EOL><DEDENT>else:<EOL><INDENT>dx = plotaxis[<NUM_LIT:1>]-plotaxis[<NUM_LIT:0>]<EOL>dy = plotaxis[<NUM_LIT:3>]-plotaxis[<NUM_LIT:2>]<EOL>ydim = <NUM_LIT:6><EOL>xdim = ydim*dx/dy<EOL><DEDENT>format = '<STR_LIT>'<EOL>if boxstable:<EOL><INDENT>for i in range(len(self.stable_el)):<EOL><INDENT>if i == <NUM_LIT:0>:<EOL><INDENT>continue<EOL><DEDENT>tmp = self.stable_el[i]<EOL>try:<EOL><INDENT>zz= self.elements_names.index(tmp[<NUM_LIT:0>]) <EOL><DEDENT>except:<EOL><INDENT>continue<EOL><DEDENT>for j in range(len(tmp)):<EOL><INDENT>if j == <NUM_LIT:0>:<EOL><INDENT>continue<EOL><DEDENT>nn = int(tmp[j]) <EOL>nn=nn-zz<EOL>xy = nn-<NUM_LIT:0.5>,zz-<NUM_LIT:0.5><EOL>rect = Rectangle(xy,<NUM_LIT:1>,<NUM_LIT:1>,ec='<STR_LIT:k>',fc='<STR_LIT:None>',fill='<STR_LIT:False>',lw=<NUM_LIT>)<EOL>rect.set_zorder(<NUM_LIT:2>)<EOL>ax2.add_patch(rect)<EOL><DEDENT><DEDENT><DEDENT>apatches = []<EOL>acolor = []<EOL>m = old_div(<NUM_LIT>,prange)<EOL>vmax=ceil(max(flux_log10_small))<EOL>vmin=max(flux_log10_small)-prange<EOL>b=-vmin*m+<NUM_LIT:0.1><EOL>normr = colors.Normalize(vmin=vmin,vmax=vmax)<EOL>ymax=<NUM_LIT:0.><EOL>xmax=<NUM_LIT:0.><EOL>for i in range(len(flux_log10_small)):<EOL><INDENT>x = coord_x_1_small[i]<EOL>y = coord_y_1_small[i]<EOL>dx = coord_x_out[i]-coord_x_1_small[i]<EOL>dy = coord_y_out[i]-coord_y_1_small[i]<EOL>if flux_log10_small[i]>=vmin:<EOL><INDENT>arrowwidth = flux_log10_small[i]*m+b<EOL>arrow = Arrow(x,y,dx,dy, width=arrowwidth)<EOL>if xmax<x:<EOL><INDENT>xmax=x<EOL><DEDENT>if ymax<y:<EOL><INDENT>ymax=y<EOL><DEDENT>acol = flux_log10_small[i]<EOL>apatches.append(arrow)<EOL>acolor.append(acol)<EOL><DEDENT>xy = x-<NUM_LIT:0.5>,y-<NUM_LIT:0.5><EOL>rect = Rectangle(xy,<NUM_LIT:1>,<NUM_LIT:1>,ec='<STR_LIT:k>',fc='<STR_LIT:None>',fill='<STR_LIT:False>',lw=<NUM_LIT:1.>)<EOL>patches.append(rect)<EOL>xy = x+dx-<NUM_LIT:0.5>,y+dy-<NUM_LIT:0.5><EOL>rect = Rectangle(xy,<NUM_LIT:1>,<NUM_LIT:1>,ec='<STR_LIT:k>',fc='<STR_LIT:None>',fill='<STR_LIT:False>',lw=<NUM_LIT:1.>)<EOL>patches.append(rect)<EOL><DEDENT>p = PatchCollection(patches,norm=<NUM_LIT:0>,facecolor='<STR_LIT:w>')<EOL>p.set_zorder(<NUM_LIT:1>)<EOL>ax2.add_collection(p)<EOL>a = PatchCollection(apatches, cmap=cmapr, norm=normr)<EOL>a.set_array(array(acolor))<EOL>a.set_zorder(<NUM_LIT:3>)<EOL>ax2.add_collection(a)<EOL>cb = pl.colorbar(a)<EOL>cb.set_label('<STR_LIT>')<EOL>if profile == '<STR_LIT>':<EOL><INDENT>cb.set_label('<STR_LIT>')<EOL><DEDENT>iarr = <NUM_LIT:2><EOL>for z in range(nzmax):<EOL><INDENT>try:<EOL><INDENT>nmin = min(argwhere(nzycheck_plot[:,z,iarr-<NUM_LIT:2>]))[<NUM_LIT:0>]-<NUM_LIT:1><EOL>nmax = max(argwhere(nzycheck_plot[:,z,iarr-<NUM_LIT:2>]))[<NUM_LIT:0>]+<NUM_LIT:1><EOL>ax2.text(nmin,z,elname[z],horizontalalignment='<STR_LIT>',verticalalignment='<STR_LIT>',fontsize='<STR_LIT>',clip_on=True)<EOL>ax2.text(nmax,z,elname[z],horizontalalignment='<STR_LIT>',verticalalignment='<STR_LIT>',fontsize='<STR_LIT>',clip_on=True)<EOL><DEDENT>except ValueError:<EOL><INDENT>continue<EOL><DEDENT><DEDENT>if imlabel:<EOL><INDENT>for z in range(nzmax):<EOL><INDENT>for n in range(nnmax_plot):<EOL><INDENT>a = z+n<EOL>if nzycheck_plot[n,z,iarr-<NUM_LIT:2>]==<NUM_LIT:1>:<EOL><INDENT>ax2.text(n,z,a,horizontalalignment='<STR_LIT>',verticalalignment='<STR_LIT>',fontsize='<STR_LIT>',clip_on=True)<EOL><DEDENT><DEDENT><DEDENT><DEDENT>if imagic==<NUM_LIT:1>:<EOL><INDENT>ixymagic=[<NUM_LIT:2>, <NUM_LIT:8>, <NUM_LIT:20>, <NUM_LIT>, <NUM_LIT:50>, <NUM_LIT>, <NUM_LIT>]<EOL>nmagic = len(ixymagic)<EOL>for magic in ixymagic:<EOL><INDENT>if magic<=nzmax:<EOL><INDENT>try:<EOL><INDENT>xnmin = min(argwhere(nzycheck[:,magic,iarr-<NUM_LIT:2>]))[<NUM_LIT:0>]<EOL>xnmax = max(argwhere(nzycheck[:,magic,iarr-<NUM_LIT:2>]))[<NUM_LIT:0>]<EOL>line = ax2.plot([xnmin,xnmax],[magic,magic],lw=<NUM_LIT>,color='<STR_LIT:r>',ls='<STR_LIT:->')<EOL><DEDENT>except ValueError:<EOL><INDENT>dummy=<NUM_LIT:0><EOL><DEDENT><DEDENT>if magic<=nnmax:<EOL><INDENT>try:<EOL><INDENT>yzmin = min(argwhere(nzycheck[magic,:,iarr-<NUM_LIT:2>]))[<NUM_LIT:0>]<EOL>yzmax = max(argwhere(nzycheck[magic,:,iarr-<NUM_LIT:2>]))[<NUM_LIT:0>]<EOL>line = ax2.plot([magic,magic],[yzmin,yzmax],lw=<NUM_LIT>,color='<STR_LIT:r>',ls='<STR_LIT:->')<EOL><DEDENT>except ValueError:<EOL><INDENT>dummy=<NUM_LIT:0><EOL><DEDENT><DEDENT><DEDENT><DEDENT>if plotaxis==[<NUM_LIT:0>,<NUM_LIT:0>,<NUM_LIT:0>,<NUM_LIT:0>]:<EOL><INDENT>ax2.axis([-<NUM_LIT:0.5>,xmax+<NUM_LIT:0.5>,-<NUM_LIT:0.5>,ymax+<NUM_LIT:0.5>])<EOL><DEDENT>else:<EOL><INDENT>ax2.axis(plotaxis)<EOL><DEDENT>ax2.set_xlabel('<STR_LIT>')<EOL>if profile == '<STR_LIT>':<EOL><INDENT>ax2.set_ylabel('<STR_LIT>')<EOL><DEDENT>if which_flux == None or which_flux == <NUM_LIT:0>:<EOL><INDENT>max_flux_label="<STR_LIT>"+str('<STR_LIT>'.format(max_flux))<EOL><DEDENT>elif which_flux == <NUM_LIT:1>:<EOL><INDENT>max_flux_label="<STR_LIT>"+str('<STR_LIT>'.format(max_flux))<EOL><DEDENT>if print_max_flux_in_plot:<EOL><INDENT>ax2.text(plotaxis[<NUM_LIT:1>]-<NUM_LIT>,plotaxis[<NUM_LIT:2>]+<NUM_LIT:0.1>,max_flux_label,fontsize=<NUM_LIT>)<EOL><DEDENT>print(graphname,'<STR_LIT>')<EOL>if show:<EOL><INDENT>pl.show()<EOL><DEDENT>if turnoff:<EOL><INDENT>ion()<EOL><DEDENT>return<EOL>
Plots an abundance and flux chart

Parameters
----------
cycle : string, integer or list
    The cycle we are looking in. If it is a list of cycles,
    this method will then do a plot for each of these cycles
    and save them all to a file.
ilabel : boolean, optional
    Elemental labels off/on.  The default is True.
imlabel : boolean, optional
    Label for isotopic masses off/on.  The default is True.
imagic : boolean, optional
    Turn lines for magic numbers off/on.  The default is False.
boxstable : boolean, optional
    Plot the black boxes around the stable elements.  The
    defaults is True.
lbound : tuple, optional
    Boundaries for colour spectrum ploted.  The default is
    (-12,0).
plotaxis : list, optional
    Set axis limit.  If [0, 0, 0, 0] the complete range in (N,Z)
    will be plotted.  It equates to [xMin, xMax, Ymin, Ymax].
    The default is [0, 0, 0, 0].
which_flux : integer, optional
    Set to 0 for nucleosynthesis flux plot.  Set to 1 for
    energy flux plot.  Setting wich_flux to 0 is equivelent to
    setting it to 0.  The default is None.
prange : integer, optional
    Range of fluxes to be considered, if prange is None then
    the plot range is set to 8.  The default is None.
profile : string, optional
    'charged' is ideal setting to show charged particle
    reactions flow.  'neutron' is ideal setting for neutron
    captures flows.  The default is 'charged'.
show : boolean, optional
    Boolean of if the plot should be displayed.  Useful with
    saving multiple plots using abu_chartMulti.  The default is
    True.