Bokeh-Heatmap-1
Sat 17 May 2025
from bokeh.plotting import figure, output_file, show
from bokeh.io import output_notebook
from bokeh.models import ColumnDataSource
import pandas as pd
# Set Bokeh output to notebook
output_notebook()
heatmap_data = pd.DataFrame({'x': [1, 1, 2, 2, 3, 3],
'y': [1, 2, 1, 2, 1, 2],
'value': [10, 20, 30, 40, 50, 60]})
heatmap_plot = figure(title="Sample Heatmap", x_axis_label='X-Axis', y_axis_label='Y-Axis')
heatmap_plot.rect(x='x', y='y', width=1, height=1, source=heatmap_data,
fill_color='blue', fill_alpha=0.4, legend_label="Heatmap")
GlyphRenderer(
id = 'p1045', …)
show(heatmap_plot)
Score: 5
Category: bokeh