Plot utilities
- triqs_maxent.plot_utils.plot_function(func)[source]
A decorator for plotting
A method decorated with this decorator shall return three arguments, specifically
x
,y
anddefault
or a list of tuples, where each tuple consists of(x, y, default)
(in the latter case, more than one line will be plotted).x
andy
represent the coordinates of the curve that shall be plotted anddefault
is a dictionary of options. These options can either by consumed by the decorated function (in any way that seems suitable) or they are passed on to the matplotlib plotting functions.There is a special keyword argument called element which is constructed from the keyword arguments
m
,n
(andc
) representing the index of the matrix element (with a possible complex indexc
).Entries starting with
n_
, e.g.n_argname
, indefault
mean that there is a keyword argumentargname
that can take the values0
ton_argname-1
.After decorating the function, it will not return the arguments anymore but rather plot the curves with the corresponding setting. The original function which is decorated is still available using
function_name.original
.If using this on methods in
MaxEntResultData
orAnalyzerResult
, the plotting GUI and theJupyterPlotMaxEnt
will automatically detect it and use the entries ofdefault
to present GUI elements to the user (see Visualization).