3
0
mirror of https://github.com/triqs/dft_tools synced 2024-12-25 22:03:43 +01:00
dft_tools/doc/reference/python/data_analysis/plotting/example.py
Olivier Parcollet f2c7d449cc First commit : triqs libs version 1.0 alpha1
for earlier commits, see TRIQS0.x repository.
2013-07-17 19:24:07 +02:00

16 lines
537 B
Python

from pytriqs.gf.local import *
from pytriqs.gf.local.descriptors import Omega
g = GfImFreq(indices = [1], beta = 50, n_points = 1000, name = "g")
g <<= inverse( Omega + 0.5 )
# open 2 panels top (t) and bottom (b)
from pytriqs.plot.mpl_interface import subplots
f, (t,b) = subplots( 2,1)
#plot ...
t.oplot(g.real, '-o', x_window = (0,10) )
b.oplot(g.imag, '-x', x_window = (0,12) )
b.oplot( lambda om : -om*0.8/(om*om + 4), name = "Bad Fit !")
b.text(5,-0.5, r'$g(i\omega_n) = \frac{1}{i \omega_n + 1/2} $', size = 20, color='r')