Bokeh-Line-With-Markers-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()
from bokeh.plotting import figure, show
# Bar Plot: No changes needed
categories = ['A', 'B', 'C', 'D', 'E']
values = [10, 20, 15, 25, 30]
bar_plot = figure(x_range=categories, title="Sample Bar Plot", x_axis_label='Categories', y_axis_label='Values')
bar_plot.vbar(x=categories, top=values, width=0.5, color='blue', legend_label="Bar")
# Line with Markers: Use scatter for markers
line_marker_plot = figure(title="Line with Markers", x_range=categories, x_axis_label='Categories', y_axis_label='Values')
line_marker_plot.line(categories, values, line_width=2, legend_label="Line")
line_marker_plot.scatter(categories, values, size=8, color="red", legend_label="Markers")
# Show plots
show(bar_plot)
show(line_marker_plot)
Score: 5
Category: bokeh