Bokeh offers several annotations for supplementary information for visualizations. It helps the viewer by adding the following information:
- Titles: This annotation provides a name to the plot.
- Axis labels: This annotation provides labels to the axis. It helps us to understand what the x and y axes represent.
- Legends: This annotation represents the third variable via color or shape and helps us to link features for easy interpretations.
- Color bars: Color bars are created using ColorMapper with the color palette.
Let's see an annotation example:
# Import the required modules
from bokeh.plotting import figure
from bokeh.plotting import output_notebook
from bokeh.plotting import show
from bokeh.models import CategoricalColorMapper
# Import iris flower dataset as pandas DataFrame
from bokeh.sampledata.iris import flowers as df
# Output to notebook
output_notebook()
# Create color mapper for categorical column
color_mapper = CategoricalColorMapper(factors=['setosa', ...