Bokeh includes several types of annotations to allow users to add supplemental information to their visualizations. Annotations are used to add notes or more information about a topic. Annotations can be titles, legends, Arrows, bands, labels etc.
Adding legends to your figures can help to properly describe and define it. Hence, giving more clarity. Legends in Bokeh are simple to implement. They can be basic, automatically grouped, manually mentioned, explicitly indexed and also interactive.
Given below is the examples to help you understand better:
Example: Basic legends
The legend_label parameter is used to add a basic label to any one of the glyph.
frombokeh.plotting importfigure, output_file, show
x =[val forval inrange(10)]
y =[val forval inrange(0, 20, 2)]
p.line(x, y, legend_label="My Red Line", line_color="red")
Please Login to comment...