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 and default 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 and y represent the coordinates of the curve that shall be plotted and default 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 (and c) representing the index of the matrix element (with a possible complex index c).

Entries starting with n_, e.g. n_argname, in default mean that there is a keyword argument argname that can take the values 0 to n_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 or AnalyzerResult, the plotting GUI and the JupyterPlotMaxEnt will automatically detect it and use the entries of default to present GUI elements to the user (see Visualization).