ESMBenchmarkViz.scatter_plot

ESMBenchmarkViz.scatter_plot(x, y, names=None, images=None, show_image_panel=False, title='Interactive Scatter Plot', width=600, height=400, show_plot=True, static=False, static_filename='./scatter_plot.png', bokeh_logo=True, debug=False)[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

  • show_image_panel (bool, optional) – If True and images are provided, displays the interactive image panel on the right side. If False, images appear only in tooltips without the panel. Default is False.

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

  • static (bool, optional) – If True, exports the plot as a static PNG file to the path specified by static_filename. Default is False.

  • static_filename (str, optional) – The file path where the static PNG will be saved when static=True. Default is “./scatter_plot.png”.

  • bokeh_logo (bool, optional) – If True, displays the Bokeh logo in the plot. Default is True.

  • debug (bool, optional) – If True, prints additional debugging information. Default is False.

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