twinlab.Emulator.plot#

Emulator.plot(x_axis, y_axis, x_fixed={}, params=<twinlab.params.PredictParams object>, x_lim=(None, None), n_points=100, label='Emulator', blur=False, color='#009FE3', figsize=(6.4, 4.8), verbose=False)[source]#

Plot the predictions from an emulator across a single dimension with one and two standard deviation bands.

This will make a call to the emulator to predict across the specified dimension. Note that a multi-dimensional emulator will be sliced across the other dimensions. The matplotlib.pyplot object is returned, and can be further modified by the user.

Parameters:
  • x_axis (str) – The name of the x-axis variable.

  • y_axis (str) – The name of the y-axis variable.

  • x_fixed (dict, optional) – A dictionary of fixed values for the other X variables. Note that all X variables of an emulator must either be specified as x_axis or appear as x_fixed keys. To pass through “None”, either leave x_fixed out or pass through an empty dictionary.

  • params (PredictParams) – (PredictParams, optional). A parameter configuration that contains optional prediction parameters.

  • x_lim ([tuple[Union[float, None], Union[float, None]]) – The limits of the x-axis. If either is not provided. the limits will be taken directly from the emulator.

  • n_points (int, optional) – The number of points to sample in the x-axis.

  • label (Union[str, None], optional) – The label for the line in the plot legend. Defaults to “Emulator”.

  • blur (bool, optional) – If True the emulator prediction will be blurred to visualize the uncertainty in the emulator. If False the mean and one and two standard deviation bands will be plotted, which encase 68% and 95% of the emulator prediction respectively.

  • color (str, optional) – The color of the plot. Defaults to digiLab blue. Can be any valid matplotlib color (https://matplotlib.org/stable/gallery/color/named_colors.html).

  • verbose (bool, optional) – Display detailed information about the operation while running.

Return type:

plot

Examples

emulator = tl.Emulator("emulator_id")
plt = emulator.plot("Time", "Temperature", x_fixed={"Latitude": 0, "Longitude": 30})
plt.show()