In order to make good graphical analysis and make plots visually attractive you can make use of layouts. The use of layouts, tabs, and grids enhances your plots and create possibilities like using the same axes.
For demonstration purpose, we first create 3 individual plots of different shapes and heights
import pandas as pd
import numpy as np
from bokeh.plotting import figure, show, ColumnDataSource
from bokeh.io import output_notebook
output_notebook()
It might be more efficient to view a single plot a time but have multiple plots on a panel. Bokeh offers the tab layout, where each plot is stored in a single tab and it can be assessed by clicking on the tab
from bokeh.models import Tabs, Panel
#create the panels
tab1 = Panel(child = plot1, title = 'Tab one')
tab2 = Panel(child = plot2, title = 'Tab two')
tab3 = Panel(child = plot3, title = 'Tab three')
#feed the tabs into the Tabs objec
tabs_object = Tabs(tabs = [tab1, tab2, tab3])
show(tabs_object)
In the example below we show one child on one tab, but two childs by the use of column on the other tab
#create the panels
tab1 = Panel(child = plot1, title = 'Tab one')
tab2 = Panel(child = column(plot2, plot3), title = 'Tab two')
#feed the tabs into the Tabs objec
tabs_object = Tabs(tabs = [tab1, tab2])
show(tabs_object)
Plot in a grid layout
A gird layout combines rows and columns and nested layouts and allows you to create plots in several directions. The grid layout is more versatile than the nested layout and you can create attractive layouts
from bokeh.layouts import gridplot
show(gridplot([plot1, plot2, plot3], ncols=2, plot_width=450, plot_height=300))
Linking plots together
Sometimes you want to compare plots with each other and therefore, you need the same y-range. The following code illustrates this