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,yanddefaultor a list of tuples, where each tuple consists of(x, y, default)(in the latter case, more than one line will be plotted).xandyrepresent the coordinates of the curve that shall be plotted anddefaultis 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, indefaultmean that there is a keyword argumentargnamethat can take the values0ton_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
MaxEntResultDataorAnalyzerResult, the plotting GUI and theJupyterPlotMaxEntwill automatically detect it and use the entries ofdefaultto present GUI elements to the user (see Visualization).