Creating visual attributes to enhance style and interactivity
Visual attributes can broadly be classified into two categories:
- Attributes that add interactivity to your plot
- Attributes that enhance the visual style of your plot
This section will lay the foundation for both these categories and show how you can fully utilize and exploit Bokeh to get the most out of your plots.
Attributes that add interactivity to the plot
The visual attributes that further enhance the interactivity of your plots are as follows:
- Hover Tooltip: Lets you point the mouse at a specific point in the plot and displays associated information
- Selection: Lets you select a region of the plot and colors that region a different color
Creating a hover tooltip
In order to create a hover tooltip, we will use the code shown here:
#Import the required packages from bokeh.models import CategoricalColorMapper from bokeh.models import HoverTool from bokeh.io import output_file, show from bokeh.plotting import ColumnDataSource from bokeh...