Basic Plotting
As mentioned before, the plotting
interface of Bokeh gives us a higher-level abstraction, which allows us to quickly visualize data points on a grid.
To create a new plot, we have to define our imports to load the necessary dependencies:
# importing the necessary dependencies import pandas as pd from bokeh.plotting import figure, show from bokeh.io import output_notebook output_notebook()
Before we can create a plot, we need to import the dataset. In the examples in this chapter, we will work with a computer hardware dataset. It can be imported by using pandas' read_csv
method.
# loading the Dataset with pandas dataset = pd.read_csv('../../Datasets/computer_hardware.csv')
The basic flow when using the plotting
interface is comparable to that of Matplotlib. We first create a figure. This figure is then used as a container to define elements and call methods on:
# adding an index column to use it for the x-axis dataset['index&apos...