Bokeh-Area-Plot-1

Sat 17 May 2025

from bokeh.plotting import figure, output_file, show
from bokeh.io import output_notebook
from bokeh.models import ColumnDataSource
# Set Bokeh output to notebook
output_notebook()
Loading BokehJS ...
from bokeh.plotting import figure, show

# Define the data
x = [1, 2, 3, 4, 5]
y = [6, 7, 2, 4, 5]

# Create the figure
area_plot = figure(title="Sample Area Plot", x_axis_label='X-Axis', y_axis_label='Y-Axis')

# Add the area plot
area_plot.varea(x=x, y1=[2, 2, 2, 2, 2], y2=y, fill_alpha=0.4, color="orange", legend_label="Area")

# Show the plot
show(area_plot)


Score: 5

Category: bokeh