In [1]:
#from __future__ import division 
#     from IPython import get_ipython
%pylab
# inline
import string
# %matplotlib qt 
#%matplotlib notebook
#%matplotlib nbagg
import matplotlib.ticker as ticker
from mpl_toolkits.axes_grid1.inset_locator import inset_axes
from mpl_toolkits.axes_grid1.inset_locator import zoomed_inset_axes, mark_inset
import os

txt = 'run'
#txt = 'OldData/run'
txt2 = '/rho_'
inp ='/input_nrg.dat'
densPath = '/home/cifucito/nrgcode/TwoChNRG/Images/Density/run'



rcParams.update({'font.size': 30})
rc("text", usetex = True)
rc("font", family = "serif")
#rcParams['figure.subplot.hspace'] = 0.3
rcParams['figure.subplot.wspace'] = 0.1
from scipy.interpolate import griddata
from scipy.optimize import curve_fit
from scipy import interpolate
mpl.rcParams['lines.linewidth'] = 2
Gamma = 2.82691*0.01
pi*Gamma


Using matplotlib backend: TkAgg
Populating the interactive namespace from numpy and matplotlib
Out[1]:
0.08880999688359521

In [2]:
#read files for folder ini and dot 
#return
def readfile(ini, dot):
        output = txt+repr(ini)+txt2 +repr(dot)+'_'+repr(dot)+'_OmegaRhow_zEQAVG.00.dat'
        
        #output = txt+repr(ini)+txt2 +repr(dot)+'_'+repr(dot)+'_OmegaRhow.dat'
        #output = 'NotSoOld_Data/'+txt+repr(ini)+txt2 +repr(dot)+'_'+repr(dot)+'_OmegaRhow.dat'
        #output = 'OldData/'+txt+repr(ini)+txt2 +repr(dot)+'_'+repr(dot)+'_OmegaRhow.dat'
        infile = open(os.path.abspath(output), 'r')
        text = infile.readlines()
        #Data managemente
        vec = [];        vec2 = []  
        for x in text:
            #print(list(x))
            a =x.split(' ') ;            vec.append(float(a[-3]))
            vec2.append(float(a[0]))
        #if j%20 == 1 : vec = vec[::-1];
        DOS= array(vec) ; w = array(vec2) 
        return DOS , w
    
zvec = ['0.60','0.80','1.00','1.20','1.40']    
def readfileZ(ini, dot, Ztrick):
        output = txt+repr(ini)+txt2 +repr(dot)+'_'+repr(dot)+'_OmegaRhow_zEQ'+zvec[Ztrick]+'.dat'
        #output = txt+repr(ini)+txt2 +repr(dot)+'_'+repr(dot)+'_OmegaRhow.dat'
        infile = open(os.path.abspath(output), 'r')
        text = infile.readlines()
        #Data managemente
        vec = [];        vec2 = []  
        for x in text:
            #print(list(x))
            a =x.split(' ') ;            vec.append(float(a[-3]))
            vec2.append(float(a[0]))
        #if j%20 == 1 : vec = vec[::-1];
        DOS= array(vec) ; w = array(vec2) 
        return DOS , w    
    
#returns the parameter value of file ini  at the given line    
def readfile_Param(ini, line):
        #output = txt+repr(ini)+txt2 +repr(dot)+'_'+repr(dot)+'_OmegaRhow_zEQAVG.00.dat'
        output = txt+repr(ini)+ inp 
        #output = '/home/cifucito/nrgcode/TwoChNRG/src/Main/Run/Run2DOtM/rho_2_2_OmegaRhow.dat'
        infile = open(os.path.abspath(output), 'r')
        text = infile.readlines()
        return  float(text[line])    
    
    
#Define the log transform. 
#Inputs : w -- vector to transform ,  maxi- max(-log(w)) usually 10
def LogTransform(w, maxi):
    logw = zeros(size(w)) ; logw[w<0] = log10(-w[w<0]) ; logw[w>0] = log10(w[w>0]) 
    logw = -logw ;  #print "b" , logw
    logw[size(logw)/2:] = -logw[size(logw)/2:]+ 2*maxi
    logw =  logw -maxi
    return logw

In [ ]:
def find_nearest(array, value):
    array = asarray(array)
    idx = (abs(array - value)).argmin()
    return idx

def integrate(N, w, rho , A):
    r = random.rand( 3, N) ;
    sum = 0 
    for n in range(N):
        i1 =  find_nearest( w, A*r[0,n]) 
        add = 1 if r[1,n]<rho[i1] else 0
        sum = add + sum
    return  A*sum/float(N)   

i = 350
dot = 3

rho, w = readfile(i, dot)
#rho1, w1 = readfile(100+i, dot)
#rho = 0.5*(rho +rho1)
rho = rho*Gamma*pi ; w = w/Gamma
plot(w, rho)


N = 100000


plot(w,rho)
Int = 0
for i in range(20):
    Int = Int + integrate(N, w, rho,100)
print Int/20.0

In [4]:
LIMSX = 10
def readMath(  title):
    #infile = open(os.path.abspath('Gamma1=0.0282691,Gamma2=0,tdots=0.02,t1=0,t2=0.02'), 'r')
    #infile = open(os.path.abspath('Gamma1=0.0282691,Gamma2=0,tdots=0.02,t1=0.02,t2=0.'), 'r')
    infile = open(os.path.abspath( title ), 'r')
    text = infile.readlines()
    Green = []
    for x in text:
         Green.append(pi*Gamma*float(x.split('\n')[0]))
    #return linspace(-10,10,500), array(Green)/(pi*Gamma)
    return linspace(-LIMSX,LIMSX,500), array(Green)
    #ax.plot(linspace(-10*Gamma,10*Gamma,500),Green, label = 'Green')
    #return linspace(-10*Gamma,10*Gamma,500),Green
    #plot(linspace(-10*Gamma,10*Gamma,500),Green, label = 'Green')
    #plot(linspace(-10,10,500),Green, label = 'Green')
#plot(Green)

def plotMath( ax , title , lb , style,col):
    w , Green = readMath( title)
    Green = Green#/(pi*Gamma)
    NLN = 4
    
    if col == 'no':
        if lb == '':
            if col == 'b' or style == ':':
                ax.plot(linspace(-LIMSX,LIMSX,500),Green, ls = style , linewidth=NLN)
            else:
                ax.plot(linspace(-LIMSX,LIMSX,500),Green, ls = style ) 
        else :
            if col == 'b' or style == ':':
                ax.plot(linspace(-LIMSX,LIMSX,500),Green, label = lb,ls = style,  linewidth=NLN)
            else:
                ax.plot(linspace(-LIMSX,LIMSX,500),Green, label = lb,ls = style)
            
    else:
        if lb == '':
            if col == 'b'or style == ':' :
                ax.plot(linspace(-LIMSX,LIMSX,500),Green, ls = style , color = col, linewidth=NLN)
            else:
                ax.plot(linspace(-LIMSX,LIMSX,500),Green, ls = style , color = col) 

        else :
            if col == 'b' or style == ':':
                ax.plot(linspace(-LIMSX,LIMSX,500),Green, label = lb,ls = style, color = col , linewidth=NLN)
            else:
                ax.plot(linspace(-LIMSX,LIMSX,500),Green, label = lb,ls = style, color = col)
            
        

def plotOneDot(ax,i , dot , SUM , Reverse): #U=8.6 \Gamma_1 
    vec , w = readfile(i, dot)
    NLN = 4
    if Reverse:
        vec = vec[::-1]
    if SUM :
        rho , vec2 = readfile(i+100, dot) 
        if Reverse:
            rho = rho[::-1]
        vec = 0.5*(rho+vec)
    #vec = vec#*pi*Gamma#*Hib
    spin = '\uparrow' if dot%2!=1 else '\downarrow'
    ln = 'b-' if dot%2!=1 else 'r-'
            #plot DOS
    p0 = vec[w>0][0]
    print p0*pi*Gamma*2   
    #plot(w/(Gamma*0.8),vec*pi*Gamma/0.944036503513, 'o',label= '$'  +spin + '$') 
    if dot%2 == 0 :
        ax.plot(w/Gamma,Gamma*pi*vec, ln,label= '$ '  +spin + '$' ,  linewidth=NLN)
    else:
        ax.plot(w/Gamma,Gamma*pi*vec, ln,label= '$ '  +spin + '$' )
#plotOneDot(22 , 0)
#plotOneDot(22 , 1)
#plotOneDot(22 , 2)
#plotOneDot(22, 3)
#plot(linspace(-10*Gamma,10*Gamma,500),Green, label = 'Green')
#readMath('DQD')
#readMath('Gamma1=0.0282691,Gamma2=0,tdots=0.02,t1=0,t2=0.02')
#xlim(-20,20)
#legend(fontsize=17, loc='lower right')


title = '/home/cifucito/nrgcode/TwoChNRG/Data/Green/Gamma1=2.,Gamma2=0.,tdots=0.,t1=5.,t2=0.,em=0.,e1=0.,e2=0..dat'
#readMath(title)

In [5]:
G2 = 1 ; tdots = 0 ;  t1 = 1 ; t2 = 1 ; em = 0 ; e1 = 0 ;e2 = 0
title = 'd1/Gamma1=2.,Gamma2='+repr(int(G2*2) ) +'.,tdots='+repr(int(tdots*2))+'.,t1='+repr(int(2*t1))+'.,t2='+ repr(int(2*t2))+'.,em='+repr(int(2*em))+'.,e1='+repr(int(2*e1))+'.,e2='+repr(int(2*e2))+'..dat'

#readMath(title)

In [ ]:


In [7]:
plotOneDot(ax, 101 , 0 , False)
plotOneDot(ax, 101 , 1 , False)
w = "35%" 
h = "35%" 
pos = (0, 0, 1.03, 1.3)
axins = inset_axes(ax,  width=w, height=h, bbox_to_anchor=pos,loc=7, bbox_transform=ax.transAxes )
plotOneDot(axins,101 , 0, False)
plotOneDot(axins,101 , 1, False)
#     axins.set_frame_on(False)
#     axins.get_xaxis().set_visible(False)
#     axins.get_yaxis().set_visible(False)
ax.set_ylim(0,1.05)
ax.set_xlim(-12,12)


axins.set_xlim(-0.8,0.8)
ax.set_yticks(arange(0,1.2, step=.5))
axins.set_xticks(arange(-0.7,0.9, step=.7))
axins.set_yticks(arange(0,1.2, step=.5))

pos = (0, 0, 1.03, 1.3)
axmod = inset_axes(ax,  width=w, height=h, bbox_to_anchor=pos,loc=6, bbox_transform=ax.transAxes )
image = imread('QD1.png',  format='png') ; axmod.imshow(image)
axmod.set_frame_on(False) ; axmod.get_xaxis().set_visible(False) ; axmod.get_yaxis().set_visible(False)


---------------------------------------------------------------------------
NameError                                 Traceback (most recent call last)
<ipython-input-7-2ca2567cc408> in <module>()
----> 1 plotOneDot(ax, 101 , 0 , False)
      2 plotOneDot(ax, 101 , 1 , False)
      3 w = "35%"
      4 h = "35%"
      5 pos = (0, 0, 1.03, 1.3)

NameError: name 'ax' is not defined

In [17]:
f, ax = subplots(1, 1, sharex='col', sharey='row', figsize=(7, 5))
plotOneDot(ax,100 , 1, False,False)
ax.set_xlabel('$\omega$',fontsize=50)
ax.set_ylabel('$\\rho$',fontsize=50)
ax.set_xticks([])
ax.set_yticks([])


1.72525130383
Out[17]:
[]

In [30]:
def plotFullDot(ax, IM , num , dot , SUM , INSET, Reverse):
    plotOneDot(ax,  num , dot , SUM , Reverse)
    plotOneDot(ax,  num , dot+1 , SUM , Reverse)
    
    
#     ax.set_ylim(0,1.05);    ax.set_xlim(-12,12)
#     ax.set_yticks(arange(0,1.2, step=.5))
    
    if INSET : 
        w = "30%" ; h = "30%"  ; pos = (-0.05, 0.01, 1.07, 1.4)
        axins = inset_axes(ax,  width=w, height=h, bbox_to_anchor=pos,loc=7, bbox_transform=ax.transAxes )
        
        plotOneDot(axins,num , dot , SUM , Reverse)
        plotOneDot(axins,num , dot+1 , SUM , Reverse)
        
        
#         Normal settings
#         axins.set_xlim(-.11,.11) ; axins.set_ylim(0,.11)
#         axins.set_xticks(arange(-0.7,0.9, step=.7))
#         axins.set_yticks(arange(0,1.2, step=.5))
#         axins.set_xlim(-1.1,1.1) ; axins.set_ylim(0,0.26)

#       t1>0
        axins.set_ylim(0,0.03)
        axins.set_xlim(-0.11,0.11)
        
        axins.set_xticks(arange(-.1,.11, step=.2))
        setp(axins.get_xticklabels(), fontsize=23)
        
        setp(axins.get_yticklabels(), fontsize=23)
        axins.set_yticks(arange(0,0.032, step=.03))


#         axins.set_xticks([])
#         axins.set_yticks([])
        
        
        
#         axins.set_yticks(arange(0,.3, step=.2))
#         axins.set_xticks(arange(-.1,.11, step=.2))
#         axins.set_yticks(arange(0,.11, step=.1))
#     ax.set_xlabel('$\omega/ \Gamma_1$')
#     ax.set_ylabel('$$\\rho \pi \Gamma_1 $')
    
    if IM!='':
        w = "120%" ; h = "120%" ;pos = (0, 0, .3, 1.1)
        axmod = inset_axes(ax,  width=w, height=h, bbox_to_anchor=pos,loc=6, bbox_transform=ax.transAxes )
        image = imread(IM,  format='png') ; axmod.imshow(image)
        axmod.set_frame_on(False) ; axmod.get_xaxis().set_visible(False) ; axmod.get_yaxis().set_visible(False)

        
# f, ax = subplots(1, 1, sharex='col', sharey='row', figsize=(7, 5))
# plotFullDot(ax, 'DQDM.png', 410 , 0 , True , True , False)
#plotFullDot(ax, 'QD1.png', 365 , 1 , False , True , False)



rcParams['figure.subplot.bottom'] = 0.19
rcParams['figure.subplot.right'] = 0.97
rcParams['figure.subplot.left'] = 0.2
rcParams['figure.subplot.top'] = 0.95


# plotFullDot(ax, 'MQD.png', 115 , 0 , False , True , False)
# ax.set_ylim(0,1);    ax.set_xlim(-12,12)
# ax.set_yticks(arange(0,1.2, step=.5))
# ax.set_ylim(0,.26);    ax.set_xlim(-12,12)
# ax.set_yticks(arange(0,.3, step=.2))

# ax.set_yticks(arange(0,31, step=.1))
# ax.set_ylim(0,0.2);    ax.set_xlim(-1.1,1.1)
# # ax.set_yticks(arange(0,.3, step=.2))
# rcParams.update({'figure.figsize': (200,200)})
# ax.set_xlabel('$\omega/ \Gamma_1$')
# ax.set_ylabel('$\\rho_1 \pi \Gamma_1 = \\rho_2 \pi \Gamma_1 $')
# ax.set_ylabel('$\\rho \pi \Gamma_1$')
# ax.legend(fontsize=23 , loc='upper left')
#plotFullDot(ax, 'QD1.png', 101 , 0 , False)

In [52]:
f, ax = subplots(1, 2, sharex='col', sharey='row', figsize=(8, 3))
rcParams['figure.subplot.bottom'] = 0.19
rcParams['figure.subplot.right'] = 0.97
rcParams['figure.subplot.left'] = 0.2
rcParams['figure.subplot.top'] = 0.95
plotFullDot(ax[0], 'IND.png', 410 , 0 , True , False , False)
plotFullDot(ax[1], '', 410 , 2 , True , True , False)
ax[0].set_ylim(0,.62);    ax[0].set_xlim(-1,1) ; ax[1].set_xlim(-1,1)
ax[0].set_xlabel('$\omega/ \Gamma_1$') ; ax[1].set_xlabel('$\omega/ \Gamma_1$')
ax[0].set_ylabel('$\\rho \pi \Gamma_1 $')
ax[0].set_title('Dot 1')
ax[1].set_title('Dot 2')
ax[1].legend(fontsize=20, loc='upper left')


1.2167372022
0.608211756631
0.121986193837
0.0608059844873
0.121986193837
0.0608059844873
Out[52]:
<matplotlib.legend.Legend at 0x7f01d7e893d0>

In [21]:
f, ax = subplots(1, 1, sharex='col', sharey='row', figsize=(7, 5))
rcParams['figure.subplot.bottom'] = 0.19
rcParams['figure.subplot.right'] = 0.97
rcParams['figure.subplot.left'] = 0.2
rcParams['figure.subplot.top'] = 0.95
plotFullDot(ax, 'DQDM.png', 451 , 0 , True , True , False)
ax.set_ylim(0,.25);    ax.set_xlim(-.5,.5)
ax.set_xlabel('$\omega/ \Gamma_1$')
ax.set_ylabel('$\\rho_1 \pi \Gamma_1 = \\rho_2 \pi \Gamma_1 $')


0.462447189577
0.231188996053
0.462447189577
0.231188996053
Out[21]:
Text(0,0.5,u'$\\rho_1 \\pi \\Gamma_1 = \\rho_2 \\pi \\Gamma_1 $')

In [32]:
#SuperPlot of Mathematica files. 6 plots in one shot
numRows = 3
numCols = 2

# t1>0
# num = [350 , 356, 366]
# t2>0
num = [370 , 376, 385]
#t1=t2
# num = [330 , 335, 335]
rcParams['figure.subplot.wspace'] = 0.04
rcParams['figure.subplot.hspace'] = 0.1
rcParams['figure.subplot.bottom'] = 0.14
rcParams['figure.subplot.right'] = 0.98
rcParams['figure.subplot.left'] = 0.18
rcParams['figure.subplot.top'] = 0.92

#f, axarr = subplots(numRows, numCols, sharex='col', sharey='row', figsize=(7, 5))
f, axarr = subplots(numRows, numCols, sharex='col', sharey='row', figsize=(7.5, 6.5))
for i in range(numRows):
    for j in range(numCols):
        print i, j
        if (i == 0) & (j == 1) :
           print i , j
           plotFullDot(axarr[i,j],'', num[i] , j*2 , False, True , False) 
#            plotFullDot(axarr[i,j],'', num[i] , j*2 , False, False , False) 
        else:
            if i < 2 :
                plotFullDot(axarr[i,j],'', num[i] , j*2 , False, False , False)
            else:
                plotFullDot(axarr[i,j],'', num[i] , j*2 , False, False , True)

# t1 = t2

#         if i == 0 :
#             plotFullDot(axarr[i,j],'', num[i] , j*2 , True, False , False)
#         elif i == 1:
#             plotFullDot(axarr[i,j],'', num[i] , 2 - j*2 , True, False , False)
#         else:
#             plotFullDot(axarr[i,j],'', num[i] , j*2 , True, False , True)
        
        axarr[2,j].set_xlabel('$\omega/ \Gamma_1$')
        axarr[i,0].set_ylabel('$$\\rho \pi \Gamma_1 $')
        
#  t1=t2
#         axarr[i,j].set_xlim(-3,3)
        
#         axarr[i,j].set_ylim(0,0.45)
#         axarr[i,0].set_yticks(arange(0,0.45, step=0.2))
#         axarr[0,j].set_ylim(0,0.3)
#         axarr[0,0].set_yticks(arange(0,0.25, step=.2))

# # t1>0
#         axarr[i,j].set_xlim(-3,3)
#         axarr[0,j].set_ylim(0,0.3)
#         axarr[1,j].set_ylim(0,0.6)
#         axarr[2,j].set_ylim(0,0.6)
        
        
#         axarr[0,0].set_yticks(arange(0,0.3, step=.2))
#         axarr[1,0].set_yticks(arange(0,0.6, step=.5))
#         axarr[2,0].set_yticks(arange(0,0.6, step=0.5))

# t2>0
        axarr[i,j].set_xlim(-3,3)
        axarr[0,j].set_ylim(0,0.6)
        axarr[1,j].set_ylim(0,0.6)
        axarr[2,j].set_ylim(0,0.6)
        
        
        axarr[0,0].set_yticks(arange(0,0.6, step=.5))
        axarr[1,0].set_yticks(arange(0,0.6, step=.5))
        axarr[2,0].set_yticks(arange(0,0.6, step=0.5))



        axarr[0,0].set_title('Dot 1')
        axarr[0,1].set_title('Dot 2')
        
for num,b in enumerate(('(a)', '(b)', '(c)', '(d)', '(e)','(f)')):
    print num/2 , num%2 , b
    axarr[num/2,num%2].text(0.05, 0.9, b, transform=axarr[num/2,num%2].transAxes, fontweight='bold', va='top')
    
rcParams.update({'figure.figsize': (500,500)}) 

# t1=t2
# DrawInsets(axarr, 0 ,  'D3.png' , 'D2V1.png' , 'D1V2.png')

# t2>0
DrawInsets(axarr, 0 ,  'D3.png' , 'D1V1.png' , 'D1V2.png')

# t1>0
# DrawInsets(axarr, 0 ,  'D2.png' , 'D1V1.png' , 'D1V2.png')
#for i in range(3):
axarr[0,1].legend(fontsize=17, loc='upper right')


Exception in Tkinter callback
Traceback (most recent call last):
  File "/usr/lib/python2.7/lib-tk/Tkinter.py", line 1544, in __call__
    return self.func(*args)
  File "/usr/lib/python2.7/dist-packages/matplotlib/backends/backend_tkagg.py", line 771, in save_figure
    initialfile=initialfile,
  File "/usr/lib/python2.7/lib-tk/tkFileDialog.py", line 130, in asksaveasfilename
    return SaveAs(**options).show()
  File "/usr/lib/python2.7/lib-tk/tkCommonDialog.py", line 48, in show
    s = w.tk.call(self.command, *w._options(self.options))
TclError: can't invoke "grab" command: application has been destroyed
0 0
1.24561843791e-17
0.949981002447
0 1
0 1
0.0503628534481
0.0251814267022
0.0503628534481
0.0251814267022
1 0
0.00981748763142
0.949827661049
1 1
0.138108993997
0.232626246494
2 0
0.0245441078382
0.950170957873
2 1
0.0808979455725
0.84132810199
0 0 (a)
0 1 (b)
1 0 (c)
1 1 (d)
2 0 (e)
2 1 (f)
Out[32]:
<matplotlib.legend.Legend at 0x7f78bb693cd0>

In [ ]:


In [ ]:


In [ ]:


In [8]:
def DefineTitles(G2 ,tdots,t1 ,t2 ,em, e1 ,e2):
    title1 = 'd1/Gamma1=2.,Gamma2='+repr(int(G2*2) ) +'.,tdots='+repr(int(tdots*2))+'.,t1='+repr(int(2*t1))+'.,t2='+ repr(int(2*t2))+'.,em='+repr(int(2*em))+'.,e1='+repr(int(2*e1))+'.,e2='+repr(int(2*e2))+'..dat'
    title2 = 'd2/Gamma1=2.,Gamma2='+repr(int(G2*2) ) +'.,tdots='+repr(int(tdots*2))+'.,t1='+repr(int(2*t1))+'.,t2='+ repr(int(2*t2))+'.,em='+repr(int(2*em))+'.,e1='+repr(int(2*e1))+'.,e2='+repr(int(2*e2))+'..dat'
    title3 = 'd3/Gamma1=2.,Gamma2='+repr(int(G2*2) ) +'.,tdots='+repr(int(tdots*2))+'.,t1='+repr(int(2*t1))+'.,t2='+ repr(int(2*t2))+'.,em='+repr(int(2*em))+'.,e1='+repr(int(2*e1))+'.,e2='+repr(int(2*e2))+'..dat'
    title4 = 'd4/Gamma1=2.,Gamma2='+repr(int(G2*2) ) +'.,tdots='+repr(int(tdots*2))+'.,t1='+repr(int(2*t1))+'.,t2='+ repr(int(2*t2))+'.,em='+repr(int(2*em))+'.,e1='+repr(int(2*e1))+'.,e2='+repr(int(2*e2))+'..dat'
    return title1 , title2, title3 , title4


def Plot2Tits(axarr , G2 ,tdots,t1 ,t2 ,em, e1 ,e2 , lb):
    tits = DefineTitles(G2 ,tdots,t1 ,t2 ,em, e1 ,e2)
    plotMath(axarr[0],tits[1],'' , '-', 'b')
   
    plotMath(axarr[0],tits[0],'', '--' , 'r')
    
    plotMath(axarr[1],tits[3],' $  \uparrow$ ' + lb , '-', 'b')
    plotMath(axarr[1],tits[2],' $\downarrow$ '+ lb , '--' , 'r')


f, axarr = subplots(1, 2, sharex='col', sharey='row', figsize=(9, 4))

G2 = 0 ; tdots = 0 ;  t1 = 0 ; t2 = 0 ; em = 0 ; e1 = 0 ;e2 = 0
for G2 in array([0,0.5,1,4]):
    Plot2Tits(axarr , G2 ,tdots,t1 ,t2 ,em, e1 ,e2 , '$\Gamma_2 ='+repr(G2)+'\Gamma_1$')
    
#for tdots in array([1,2,4]):
#    Plot2Tits(axarr , 0 ,tdots,t1 ,t2 ,em, e1 ,e2 , '$t_{dots}='+repr(tdots)+'\Gamma_1$')      
#



#plotMath(axarr[0],tits[1],'Spin-$\uparrow$', '-')
#plotMath(axarr[1],tits[3],'Spin-$\uparrow$', '-')
#for t1 in array([1,2,3.5]):
#    Plot2Tits(axarr , 0 ,1,t1 ,t2 ,em, e1 ,e2 , '$t_{1}='+repr(t1)+'\Gamma_1$')      
#

#for t2 in array([1,2,3.5]):
#    Plot2Tits(axarr , 0 ,1,t1 ,t2 ,em, e1 ,e2 , '$t_{2}='+repr(t2)+'\Gamma_1$')      
#

G2 = 0 ; tdots = 0 ;  t1 = 0 ; t2 = 0 ; em = 0 ; e1 = 0 ;e2 = 0
#for G2 in array([0,0.5,1,4]):
#Plot2Tits(axarr , G2 ,1, 0,2 ,em, 0 , 0 , '')
#Plot2Tits(axarr , G2 ,1, 2,0 ,em, 0 , 5 , '')
Plot2Tits(axarr , 1 ,0, 1,1 ,em, 0 , 6 , '')


axarr[0].set_ylim(0,12)
axarr[0].set_xlim(-LIMSX,LIMSX)
axarr[1].set_xlim(-LIMSX,LIMSX)
axarr[0].set_title('Dot 1')
axarr[1].set_title('Dot 2')
axarr[0].set_xlabel('$\omega/ \Gamma_1$')
axarr[1].set_xlabel('$\omega/ \Gamma_1$')
axarr[0].set_ylabel('DOS')
axarr[1].legend(fontsize=18 , loc='upper right' )
axarr[0].set_xticks((-8,-4,0,4,8))
axarr[1].set_xticks((-8,-4,0,4,8))
axarr[0].set_yticks((0,5,10))


---------------------------------------------------------------------------
IOError                                   Traceback (most recent call last)
<ipython-input-8-89da89f25924> in <module>()
     21 G2 = 0 ; tdots = 0 ;  t1 = 0 ; t2 = 0 ; em = 0 ; e1 = 0 ;e2 = 0
     22 for G2 in array([0,0.5,1,4]):
---> 23     Plot2Tits(axarr , G2 ,tdots,t1 ,t2 ,em, e1 ,e2 , '$\Gamma_2 ='+repr(G2)+'\Gamma_1$')
     24 
     25 #for tdots in array([1,2,4]):

<ipython-input-8-89da89f25924> in Plot2Tits(axarr, G2, tdots, t1, t2, em, e1, e2, lb)
      9 def Plot2Tits(axarr , G2 ,tdots,t1 ,t2 ,em, e1 ,e2 , lb):
     10     tits = DefineTitles(G2 ,tdots,t1 ,t2 ,em, e1 ,e2)
---> 11     plotMath(axarr[0],tits[1],'' , '-', 'b')
     12 
     13     plotMath(axarr[0],tits[0],'', '--' , 'r')

<ipython-input-5-d976d3bd90ce> in plotMath(ax, title, lb, style, col)
     17 
     18 def plotMath( ax , title , lb , style,col):
---> 19     w , Green = readMath( title)
     20     Green = Green#/(pi*Gamma)
     21     NLN = 4

<ipython-input-5-d976d3bd90ce> in readMath(title)
      3     #infile = open(os.path.abspath('Gamma1=0.0282691,Gamma2=0,tdots=0.02,t1=0,t2=0.02'), 'r')
      4     #infile = open(os.path.abspath('Gamma1=0.0282691,Gamma2=0,tdots=0.02,t1=0.02,t2=0.'), 'r')
----> 5     infile = open(os.path.abspath( title ), 'r')
      6     text = infile.readlines()
      7     Green = []

IOError: [Errno 2] No such file or directory: '/home/cifu/nrgcode/Data/d2/Gamma1=2.,Gamma2=8.,tdots=0.,t1=0.,t2=0.,em=0.,e1=0.,e2=0..dat'

In [8]:
axarr[1].legend(fontsize=20, loc='upper left' )
#axarr[0].set_yticks((0,5,10,15))
axarr[0].set_xticks((-8,-4,0,4,8))
axarr[1].set_xticks((-8,-4,0,4,8))
#axarr[0].set_yticks((0,3,6,9,12))


Out[8]:
[<matplotlib.axis.XTick at 0x7fd203c4cfd0>,
 <matplotlib.axis.XTick at 0x7fd203c62150>,
 <matplotlib.axis.XTick at 0x7fd208247210>,
 <matplotlib.axis.XTick at 0x7fd208242310>,
 <matplotlib.axis.XTick at 0x7fd208242a10>]

In [270]:


In [13]:
#SuperPlot of Mathematica files. 6 plots in one shot
def Plot4Tits(axarr , G2 ,tdots,t1 ,t2 , lb ):
    tits = DefineTitles(G2 ,tdots,t1 ,t2 ,0, 0 ,0)
    plotMath(axarr[0,0],tits[1],'\uparrow' , '-', 'b')
    plotMath(axarr[0,0],tits[0],'\downarrow', '-' , 'r')
    plotMath(axarr[0,1],tits[3],' $  \uparrow$ ' + lb , '-', 'b')
    plotMath(axarr[0,1],tits[2],' $\downarrow$ '+ lb , '-' , 'r')
    tits = DefineTitles(G2 ,tdots,t1 ,t2 ,0, 5 ,0)
    plotMath(axarr[1,0],tits[1],'\uparrow' , '-', 'b')
    plotMath(axarr[1,0],tits[0],'\downarrow', '-' , 'r')
    plotMath(axarr[1,1],tits[3],' $  \uparrow$ ' + lb , '-', 'b')
    plotMath(axarr[1,1],tits[2],' $\downarrow$ '+ lb , '-' , 'r')
    tits = DefineTitles(G2 ,tdots,t1 ,t2 ,0, 0 ,-5)
    plotMath(axarr[2,0],tits[1],'\uparrow' , '-', 'b')
    plotMath(axarr[2,0],tits[0],'\downarrow', '-' , 'r')
    plotMath(axarr[2,1],tits[3],' $  \uparrow$ ' + lb , '-', 'b')
    plotMath(axarr[2,1],tits[2],' $\downarrow$ '+ lb , '-' , 'r')    
    
#SuperPlot of Mathematica files. 6 plots in one shot. More flexibility and inner for.     
def PlotNewARR(axarr , lb ):
    lt = [':','--','-']
    
    G2 = 0 ; tdots = 0 ; t1 = 0 ; t2 = 0
    for n in range(3):
        Gvec = [0,1,2] ;  G2 = Gvec[n] 
        tits = DefineTitles(G2 ,tdots,t1 ,t2 ,0, 0 ,0)
        print "G2 =" + repr(G2) +  ', tdots =' +repr(tdots) + ', t1 =' +repr(t1) +  ', t2 =' + repr(t2)
        plotMath(axarr[0,0],tits[1],'' , lt[n], 'no')
        #plotMath(axarr[0,0],tits[0],'', '-' , 'no')
        plotMath(axarr[0,1],tits[3],'$\Gamma_2 = ' + repr(G2) + '\Gamma_1$', lt[n], 'no')
        #plotMath(axarr[0,1],tits[2],' $\downarrow$ '+ lb , '-' , 'no')
         
    
    G2 = 0 ; tdots = 0 ; t1 = 0 ; t2 = 0
    for n in range(3):
        tdvec = [0,1,2] ;  tdots = tdvec[n] 
        tits = DefineTitles(G2 ,tdots,t1 ,t2 ,0, 0 ,0)
        print "G2 =" + repr(G2) +  ', tdots =' +repr(tdots) + ', t1 =' +repr(t1) +  ', t2 =' + repr(t2)
        plotMath(axarr[1,0],tits[1],'' , lt[n], 'no')
#         plotMath(axarr[0,0],tits[0],'', '-' , 'r')
        plotMath(axarr[1,1],tits[3],'$t_{dots} = ' + repr(tdots) + '\Gamma_1$' , lt[n], 'no')
#         plotMath(axarr[0,1],tits[2],' $\downarrow$ '+ lb , '-' , 'r')
        
    
    G2 = 1 ; tdots = 0 ; t1 = 0 ; t2 = 0
    for n in range(3):
        tdvec = [0,1,3] ;  tdots = tdvec[n]
        tits = DefineTitles(G2 ,tdots,t1 ,t2 ,0, 0 ,0)
        print "G2 =" + repr(G2) +  ', tdots =' +repr(tdots) + ', t1 =' +repr(t1) +  ', t2 =' + repr(t2)
        plotMath(axarr[2,0],tits[1],'' , lt[n], 'no')
#         plotMath(axarr[0,0],tits[0],'', '-' , 'r')
        plotMath(axarr[2,1],tits[3],'$t_{dots} = ' + repr(tdots) + '\Gamma_1$' , lt[n], 'no')
#         plotMath(axarr[0,1],tits[2],' $\downarrow$ '+ lb , '-' , 'r')

def DrawInsets(axarr , column , im1 , im2 , im3):
    
#     w = "50%" 
#     h = "40%" 
#     pos = (0, 0, 1.2, 1.25)
    pos = (0, 0, 1.31, 1.25)
    pos2 = (0, 0, 1.25, 1.25)
    w = "60%" 
    h = "50%" 
    
    
    axins0 = inset_axes(axarr[0,column], width=w, height=h, bbox_to_anchor=pos,loc=7, bbox_transform=axarr[0,column].transAxes )
    axins0.set_frame_on(False)
    axins0.get_xaxis().set_visible(False)
    axins0.get_yaxis().set_visible(False)
    
    pos = pos2
    axins1 = inset_axes(axarr[1,column],  width=w, height=h, bbox_to_anchor=pos,loc=7, bbox_transform=axarr[1,column].transAxes )
    axins1.set_frame_on(False)
    axins1.get_xaxis().set_visible(False)
    axins1.get_yaxis().set_visible(False)

    axins2 = inset_axes(axarr[2,column],  width=w, height=h, bbox_to_anchor=pos,loc=7, bbox_transform=axarr[2,column].transAxes )
    axins2.set_frame_on(False)
    axins2.get_xaxis().set_visible(False)
    axins2.get_yaxis().set_visible(False)
    
    image = imread(im1,  format='png')
    axins0.imshow(image)

    image = imread(im2,  format='png')
    axins1.imshow(image)

    image = imread(im3 ,  format='png')
    axins2.imshow(image)
    
#     image = imread('D3.png')
#     axins0.imshow(image)

#     image = imread('D2.png')
#     axins1.imshow(image)

#     image = imread('D1.png')
#     axins2.imshow(image)
#axins.set_visible(False)
# , bbox_to_anchor=(0.4,0.1)
# axins = axarr[2,1].inset_axes([0.5, 0.5, 0.47, 0.47])

In [ ]:


In [97]:
# f, axarr = subplots(3, 2, sharex='col', sharey='row', figsize=(6, 5.6))
f, axarr = subplots(3, 2, sharex='col', sharey='row', figsize=(6.8, 6.8))
# f, axarr = subplots(3, 2, sharex='col', sharey='row', figsize=(12, 11))
print axarr[0,0]

rcParams['figure.subplot.wspace'] = 0.04
rcParams['figure.subplot.hspace'] = 0.1
rcParams['figure.subplot.bottom'] = 0.13
rcParams['figure.subplot.right'] = 0.98
rcParams['figure.subplot.left'] = 0.16
rcParams['figure.subplot.top'] = 0.92


for num,b in enumerate(('(a)', '(b)', '(c)', '(d)', '(e)','(f)')):
    print num/2 , num%2 , b
    axarr[num/2,num%2].text(0.05, 0.9, b, transform=axarr[num/2,num%2].transAxes, fontweight='bold', va='top')
    
for i in range(3):
    for j in range(2):
#         axarr[0,j].set_ylim(0,12)
# #         axarr[0,j].set_ylim(0,3.1)
#         #axarr[1,j].set_ylim(0,21)
#         axarr[1,j].set_ylim(0,15)
#         axarr[2,j].set_ylim(0,7)

#    cong for t1 = t2
        axarr[0,j].set_ylim(0,0.4)
        axarr[1,j].set_ylim(0,1.1)
        axarr[2,j].set_ylim(0,1.1)
        axarr[0,0].set_yticks(arange(0,.4, step=.2))
        axarr[1,0].set_yticks(arange(0,1.1, step=.5))
        axarr[2,0].set_yticks(arange(0,1.1, step=0.5))
        
    
#     cong for t1 > 0 connected t2 = G2 =0
#         axarr[0,j].set_ylim(0,1.6)
#         axarr[1,j].set_ylim(0,1.7)
#         axarr[2,j].set_ylim(0,1.7)
#         axarr[0,0].set_yticks(arange(0,1.6, step=.5))
#         axarr[1,0].set_yticks(arange(0,1.7, step=.5))
#         axarr[2,0].set_yticks(arange(0,1.7, step=0.5)).

#     cong for t2>0 connected t1 = G2 =0
#         axarr[0,j].set_ylim(0,1.6)
#         axarr[1,j].set_ylim(0,1.7)
#         axarr[2,j].set_ylim(0,1.7)
#         axarr[0,0].set_yticks(arange(0,1.6, step=.5))
#         axarr[1,0].set_yticks(arange(0,1.7, step=.5))
#         axarr[2,0].set_yticks(arange(0,1.7, step=0.5))
        
        
        #axarr[i,j].text(0.1, 0.9, 'A', transform=axarr[i,j].transAxes, fontweight='bold', va='top')
        #axarr[1,0].text(-0.3, 0.5, 'B', transform=axarr[1,1].transAxes, fontweight='bold', va='top')
        
        
#         axarr[0,0].set_yticks(arange(0,3.1, step=1))
#         axarr[0,0].set_yticks(arange(0,13, step=5))
#         #axarr[0,0].set_yticks((0,5,10))
#         axarr[1,0].set_yticks(arange(0,13, step=5))
#         axarr[2,0].set_yticks(arange(0,7, step=2))
        
       
        
        axarr[0,0].set_ylabel('$\\rho \pi \Gamma_1 $'  , fontsize=24)
        axarr[1,0].set_ylabel('$\\rho \pi \Gamma_1$' , fontsize=24)
        axarr[2,0].set_ylabel('$\\rho \pi \Gamma_1$', fontsize=24)
#         axarr[0,0].set_ylabel('$\\rho(\omega) $'  , fontsize=24)
#         axarr[1,0].set_ylabel('$\\rho(\omega)$' , fontsize=24)
#         axarr[2,0].set_ylabel('$\\rho(\omega)$', fontsize=24)
        
        #axarr[0,0].set_ylabel('$ \\mathbf{ \epsilon_{1,2} = 0 }$ \n  $\\rho(\omega) $'  , fontsize=26)
        #axarr[1,0].set_ylabel('$ \\mathbf{ \epsilon_1 = 5\Gamma_1}$ \n $\\rho(\omega)$' , fontsize=24)
        #axarr[2,0].set_ylabel('$ \\mathbf{\epsilon_2 = -5\Gamma_1}$ \n $\\rho(\omega)$', fontsize=24)
        
        axarr[2,j].set_xticks((-8,-4,0,4,8))
        
        axarr[2,j].set_xlabel('$\omega/ \Gamma_1$')
        axarr[0,0].set_title('Dot 1')
        axarr[0,1].set_title('Dot 2')

        
#Plot4Tits(axarr , 0 ,1.5, 3,0, '')
# DrawInsets(axarr, 1 ,  'D3.png' , 'D2.png' , 'D1.png')
# Plot4Tits(axarr , 1 ,0, 2,2, '')
# Plot4Tits(axarr , G2 ,tdots,t1 ,t2 , lb ):

# t1=t2
Plot4Tits(axarr , 1 ,0, 2,2, '')
DrawInsets(axarr, 1 , 'D3.png' , 'D2V1.png' , 'D1V2.png')

# t1>0
# Plot4Tits(axarr , 0 ,1, 2,0, '')
# DrawInsets(axarr, 1 ,  'D2.png' , 'D2V1.png' , 'D1V2.png')

# t2 >  0
# Plot4Tits(axarr , 0 ,1, 0,2, '')
# DrawInsets(axarr, 1 , 'D3.png' , 'D4V1.png' , 'D3V2.png')



rcParams.update({'figure.figsize': (200,200)})
#DrawInsets(axarr, 0 ,  'DQD1.png' , 'DQD2.png' , 'DQD3.png')
#PlotNewARR(axarr , '' )
#for i in range(3):
axarr[0,0].legend(fontsize=17, loc='upper right')


AxesSubplot(0.18,0.67625;0.392157x0.24375)
0 0 (a)
0 1 (b)
1 0 (c)
1 1 (d)
2 0 (e)
2 1 (f)
Out[97]:
<matplotlib.legend.Legend at 0x7f63d63ca950>

In [ ]:


In [259]:
# for i,b in enumerate(('(a)', '(b)', '(c)', '(d)', '(e)','(f)')):
#     print i , b
    
# fig = figure()
# for i, label in enumerate(('A', 'B', 'C', 'D')):
#     ax = fig.add_subplot(2,2,i+1)
#     ax.text(0.05, 0.95, label, transform=ax.transAxes,
#      fontsize=16, fontweight='bold', va='top')

#plt.show() 

image = imread('D1.png')
imshow(image)


Out[259]:
<matplotlib.image.AxesImage at 0x7efdd2816090>

In [7]:
f, axarr = subplots(2, 2,  sharex='col',sharey='row', figsize=(6, 6.6))
print axarr[0,0]

rcParams['figure.subplot.wspace'] = 0.06
rcParams['figure.subplot.hspace'] = 0.19
rcParams['figure.subplot.bottom'] = 0.16
rcParams['figure.subplot.right'] = 0.99
rcParams['figure.subplot.left'] = 0.2

def PlotMode(axarr , NumCase , G2 ,tdots,t1 ,t2 , lb ,SUM):
    i = NumCase
    tits = DefineTitles(G2 ,tdots,t1 ,t2 ,0, 0 ,0)
    plotMath(axarr[0,0],tits[1],'' , '-', 'b')
    plotMath(axarr[0,0],tits[0],'', '--' , 'r')
    plotMath(axarr[0,1],tits[3],' $  \uparrow$ ' + lb , '-', 'b')
    plotMath(axarr[0,1],tits[2],' $\downarrow$ '+ lb , '--' , 'r')
    tits = DefineTitles(G2 ,tdots,t1 ,t2 ,0, 0 ,5)
    plotOneDot(axarr[1,0],i , 0 ,SUM)
    plotOneDot(axarr[1,0],i , 1 ,SUM)
    plotOneDot(axarr[1,1],i , 2 ,SUM)
    plotOneDot(axarr[1,1],i , 3 ,SUM)

    
#y1 = 3.2  ;  ystep1=1
#y2 = 3.2  ;  ystep2=1
y1 = 16.2  ;  ystep1=4
y2 = 6.2  ;  ystep2=2
for i in range(2):
    for j in range(2):
        axarr[i,j].set_xlim(-10,10)
        axarr[0,j].set_xlabel('$\omega/ \Gamma_1$')
        axarr[1,j].set_xlabel('$(\omega / \Gamma_1)(U/ \Gamma_1)$')
        
        axarr[0,j].set_ylim(0,y1)
        axarr[0,j].set_yticks(arange(0,y1, step=ystep1))
        axarr[1,j].set_ylim(0,y2)
        axarr[1,j].set_yticks(arange(0,y2, step=ystep2))
        #axarr[1,j].set_ylim(0,3)
       # axarr[1,0].set_yticks((0,1,2,3))
        #axarr[1,j].set_xticks((-8,-4,0,4,8))
        axarr[1,j].set_xticks((-8,0,8))
        axarr[0,0].set_ylabel('$\\textbf{U = 0}$ \n  $ \\rho(\omega)$' )
        axarr[1,0].set_ylabel('$\\textbf{U=17} \\mathbf{\Gamma_1} $ \n  $  \\rho(\omega) $')
        
        axarr[0,0].set_title('Dot 1')
        axarr[0,1].set_title('Dot 2')

#PlotMode(axarr , 818 ,1 ,0, 2,2, '', True)    
#PlotMode(axarr , 304 ,0 ,1, 2,0, '',False) 
PlotMode(axarr , 309 ,0 ,1, 0,2, '',False)


AxesSubplot(0.125,0.53;0.369048x0.35)
---------------------------------------------------------------------------
NameError                                 Traceback (most recent call last)
<ipython-input-7-d894488a8192> in <module>()
     48 #PlotMode(axarr , 818 ,1 ,0, 2,2, '', True)
     49 #PlotMode(axarr , 304 ,0 ,1, 2,0, '',False)
---> 50 PlotMode(axarr , 309 ,0 ,1, 0,2, '',False)

<ipython-input-7-d894488a8192> in PlotMode(axarr, NumCase, G2, tdots, t1, t2, lb, SUM)
     10 def PlotMode(axarr , NumCase , G2 ,tdots,t1 ,t2 , lb ,SUM):
     11     i = NumCase
---> 12     tits = DefineTitles(G2 ,tdots,t1 ,t2 ,0, 0 ,0)
     13     plotMath(axarr[0,0],tits[1],'' , '-', 'b')
     14     plotMath(axarr[0,0],tits[0],'', '--' , 'r')

NameError: global name 'DefineTitles' is not defined

In [ ]:


In [ ]:


In [192]:


In [ ]:


In [15]:
i = 458
#i = 817

i = 465
#i = 304
#i = 318
f, axarr = subplots(1, 2, sharex='col', sharey='row', figsize=(10, 5))

plotOneDot(axarr[0],i , 0)
plotOneDot(axarr[0],i , 1)
plotOneDot(axarr[1],i , 2)
plotOneDot(axarr[1],i , 3)

axarr[0].set_ylim(0,6)
axarr[0].set_xlim(-10,10)
axarr[1].set_xlim(-10,10)
axarr[0].set_title('Dot 1')
axarr[1].set_title('Dot 2')
axarr[0].set_xlabel('$(\omega / \Gamma_1) \\times (U/ \Gamma_1)$')
axarr[1].set_xlabel('$(\omega / \Gamma_1) \\times (U/ \Gamma_1)$')
axarr[0].set_ylabel('DOS')
axarr[1].legend(fontsize=18 , loc='upper right' )
#axarr[1].legend(fontsize=20, loc='upper right')
#axarr[0].set_xlim(-10,10)
#axarr[1].set_xlim(-10,10)
#axarr[0].set_xticks((-1.5,0,1.5))
#axarr[1].set_xticks((-1.5,0,1.5))

#axarr[0].set_ylim(0,11)
#axarr[0].set_yticks((0,1,2,3))

#axarr[0].set_title('Dot 1')
#axarr[1].set_title('Dot 2')

#axarr[0].set_xlabel('$\omega/\Gamma$')
#axarr[1].set_xlabel('$\omega/\Gamma$')
#axarr[0].set_ylabel('DOS')
axarr[1].legend(fontsize=18 , loc='upper right' )
print readfile_Param(i, 12) , readfile_Param(i, 13)


0.210479176604
0.125096967206
0.371148567426
0.384840804128
0.02 0.02

In [24]:
axarr[1].legend(fontsize=20, loc='upper left' )
#axarr[0].set_yticks((0,5,10,15))
axarr[0].set_yticks((0,1,2,3,4))
#axarr[0].set_yticks((0,3,6,9,12))


Out[24]:
[<matplotlib.axis.YTick at 0x7f9031f6f610>,
 <matplotlib.axis.YTick at 0x7f9031f6fe10>,
 <matplotlib.axis.YTick at 0x7f9032be4c90>,
 <matplotlib.axis.YTick at 0x7f9032c51c50>,
 <matplotlib.axis.YTick at 0x7f9032e57290>]

In [63]:
#mpl.rcParams['lines.linewidth'] = 3
f, axarr = subplots(1, 1, sharex='col', sharey='row', figsize=(10, 5))
G2 = 0 ; tdots = 0 ;  t1 = 0 ; t2 = 0 ; em = 0 ; e1 = 0 ;e2 = 0 
#for t1 in array([0.5,1,2]):
    #Plot2Tits(axarr , 0 ,tdots,t1 ,t2 ,em, e1 ,e2 , '$t='+repr(t1)+'\Gamma_1$') 
#    tits = DefineTitles(G2 ,tdots,t1 ,t2 ,em, e1 ,e2)
#    plotMath(axarr,tits[0],'Spin-$\downarrow , \ t='+repr(t1)+'\Gamma_1$', '--')

#for e1 in array([1,2,5]):
    #Plot2Tits(axarr , 0 ,tdots,t1 ,t2 ,em, e1 ,e2 , '$t='+repr(t1)+'\Gamma_1$') 
#    tits = DefineTitles(G2 ,tdots,1 ,t2 ,em, e1 ,e2)
#    plotMath(axarr,tits[0],'Spin-$\downarrow , \ \epsilon_1='+repr(e1)+'\Gamma_1$', '--')
    #plotMath(axarr,tits[1],'Spin-$\uparrow$' , '-')

#   
#for em in array([0.5,1,3]):
    #Plot2Tits(axarr , 0 ,tdots,t1 ,t2 ,em, e1 ,e2 , '$t='+repr(t1)+'\Gamma_1$') 
#    tits = DefineTitles(G2 ,tdots,1 ,t2 ,em, e1 ,e2)
#    plotMath(axarr,tits[0],'Spin-$\downarrow , \ \epsilon_m='+repr(em)+'\Gamma_1$', '--')
    #plotMath(axarr,tits[1],'Spin-$\uparrow$' , '-')

    
axarr.set_ylim(0,1)
axarr.set_title('')
axarr.set_xlabel('$\omega/ \Gamma_1$')
axarr.set_ylabel('DOS')
axarr.legend(fontsize=18 , loc='upper right' )


/usr/lib/python2.7/dist-packages/matplotlib/axes/_axes.py:519: UserWarning: No labelled objects found. Use label='...' kwarg on individual plots.
  warnings.warn("No labelled objects found. "

In [65]:
axarr[1].legend(fontsize=15, loc='upper left' )


Out[65]:
<matplotlib.legend.Legend at 0x7fe21e02d2d0>

In [52]:
'Green/Gamma1=2.,Gamma2=2.,tdots=0.,t1=2.,t2=2.,em=0.,e1=0.,e2=0..dat'
readMath('Green/Gamma1=2.,Gamma2=2.,tdots=0.,t1=2.,t2=2.,em=0.,e1=0.,e2=0..dat')

In [53]:
'Green/Gamma1=2.,Gamma2=2.,tdots=0.,t1=2.,t2=2.,em=0.,e1=0.,e2=0..dat'
readMath('Green/Gamma1=2.,Gamma2=2.,tdots=0.,t1=2.,t2=2.,em=0.,e1=0.,e2=0..dat')

In [29]:
print 'Green/Gamma1=2.,Gamma2='+repr(int(G2*2))


  File "<ipython-input-29-62e236601272>", line 1
    print 'Green/Gamma1=2.,Gamma2='+repr(int(G2*2)
                                                  ^
SyntaxError: unexpected EOF while parsing

In [114]:
linspace(0, 3 , 4)


Out[114]:
array([ 0.,  1.,  2.,  3.])

In [ ]: