ESMBenchmarkViz.scatter_plot

ESMBenchmarkViz.scatter_plot(x, y, names=None, images=None, title='Interactive Scatter Plot', width=600, height=400, show_plot=True)[source]

Create an interactive scatter plot with tooltips, dropdown, and an image display.

Parameters:
  • x (list or np.ndarray) – List of x-coordinates values.

  • y (list or np.ndarray) – List of y-coordinates values.

  • names (list) – List of names corresponding to the data points.

  • images (list, optional) – List of image file paths corresponding to the data points, by default None

  • title (str, optional) – Title of the plot, by default “Interactive Scatter Plot”

  • width (int, optional) – Width of the plot, by default 600

  • height (int, optional) – Height of the plot, by default 400

  • show_plot (bool, optional) – If True, the plot will be displayed in the workflow (default is True).

Returns:

bokeh.plotting.Figure or bokeh.layouts.layout – The layout containing the scatter plot and controls.

Example

>>> from ESMBenchmarkViz import scatter_plot
>>> x = [1, 2, 3]
>>> y = [6, 7, 2]
>>> names = ["A", "B", "C"]
>>> images = ["images/image1.jpg", "images/image2.jpg", "images/image3.jpg"]
>>> scatter_plot(x, y, names, images)

Example use case can be found here.

Notes

2024-11-18: Jiwoo Lee, initial version