triqs.plot.protocol.plot_protocol_apply
- triqs.plot.protocol.plot_protocol_apply(ob, opt_dict, xlims)[source]
Apply the plot protocol to an arbitrary object.
Dispatches
obto the most specific plot-protocol handler available, in this order:ob._plot_(opt_dict)ifobexposes a_plot_method.plot_function_table[type(ob)](ob, opt_dict)iftype(ob)is registered inplot_function_table.If
obis callable, sample it on a uniform grid ofn_points(default 100) points spanningx_window(taken fromopt_dictorxlims()as a fallback).Otherwise, treat
obas an iterable of(x, y)pairs.
Complex-valued ordinates are split into separate real and imaginary curves labelled
"Re <name>"and"Im <name>".- Parameters:
- obobject
Object to be plotted. Must implement the plot protocol, be registered in
plot_function_table, be callable, or be an iterable of(x, y)pairs.- opt_dictdict
Plotting options. Keys consumed here (
n_points,x_window,name) are popped; remaining keys are forwarded inside the returned curve dictionaries.- xlimscallable
Zero-argument callable returning
(xmin, xmax)for the sampling window whenobis callable and nox_windowwas given. Typicallymatplotlib.pyplot.xlim.
- Returns:
- list of dict
Curve dictionaries as described in the module docstring.
- Raises:
- RuntimeError
If
obdoes not match any of the supported forms.