Interactive Scatter Plot
This notebook shows usage examples of interactive Scatter Plot. Detailed API description can be found here.
Import functions
[1]:
from bokeh.plotting import output_file, save, output_notebook
from ESMBenchmarkViz import scatter_plot
[2]:
# Enable Bokeh output in the notebook
output_notebook()
1: Basic usage
Example 1 show basic usage of the function.
[3]:
x = [1, 2, 3]
y = [6, 7, 2]
names = ["Point A", "Point B", "Point C"]
# Create the plot layout
p = scatter_plot(x, y, names)
2: Basic usage with images
Example 2 exapands to include images.
[4]:
x = [1, 2, 3]
y = [6, 7, 2]
names = ["Point A", "Point B", "Point C"]
images = [
"images/image1.jpg", # Example of a valid image URL
None, # Example of no image (None value)
"images/image3.jpg", # Example of another valid image URL
]
# Create the plot layout
p = scatter_plot(x, y, names, images=images)
Save the plot
[5]:
# set output to static HTML file
output_file(filename="interactive_scatter_plot.html", title="Interactive Scatter Plot")
# save the results to a file
save(p)
# Result: [`interactive_scatter_plot.html`](interactive_scatter_plot.html)
[5]:
'/Users/lee1043/Documents/Research/git/ESMBenchmarkViz/docs/examples/interactive_scatter_plot.html'