twinlab.Emulator.plot#

Emulator.plot(x_axis, y_axis, x_fixed={}, params=<twinlab.params.PredictParams object>, x_lim=None, n_points=100, label='Emulator', color='#009FE3', 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.

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

  • float] – The limits of the x-axis. If not provided. the limits will be taken directly from the emulator.

  • optional] – The limits of the x-axis. If 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 (str, optional) – The label for the line in the plot. defaults to “Emulator prediction”.

  • 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()