3
0
mirror of https://github.com/triqs/dft_tools synced 2024-11-01 11:43:47 +01:00
dft_tools/doc/reference/plotting_protocols/plotting/example.py
tayral edd1ff4529 Restructuring documentation.
A first general restructuration of the doc according to the pattern [tour|tutorial|reference].
In the reference part, objects are documented per topic.
In each topic, [definition|c++|python|hdf5] (not yet implemented)
2014-10-18 12:21:08 +01: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')