I’m trying to plot two plots, one above the other using gridplot
.
I have a function that plots several line plots and returns the curplot
and I call this twice to pass the two plots to gridplot
This results in the output below:
Javascript error adding output!
TypeError: Cannot read property ‘buttonText’ of undefined
See your browser Javascript console for more details.
Should this work or am I doing something wrong? I’m on bokeh 0.6.1.dev.20140923.
Below is an example of what I’m trying to do which fails for me:
import numpy as np
from numpy.random import randn
import pandas as pd
import bokeh.plotting as plt
from bokeh.objects import DatetimeTickFormatter, DatetimeAxis, HoverTool, ColumnDataSource
plt.output_notebook(force=True)
def plot_gbm(title):
plt.figure(
title=title,
title_text_font_size="20pt",
plot_width=900,
plot_height=700,
x_axis_type="datetime",
)
dates = pd.date_range('01-Jan-2015', '01-Jan-2016', freq='D')[:-1]
plt.hold()
tools="pan,box_zoom,wheel_zoom,reset,hover"
plt.line(
dates, randn(dates.size).cumsum(),
color='blue',
legend='Series 1',
tools=tools,
)
plt.line(
dates, randn(dates.size).cumsum(),
color='red',
legend='Series 2',
tools=tools,
)
formats = {
'months': ["%b-%y"],
'days': ["%d-%b"],
}
plt.xaxis()[0].formatter = DatetimeTickFormatter(formats=formats)
return plt.curplot()
plt.gridplot([[plot_gbm('Plot A')],[plot_gbm('Plot B')]])
plt.show()
Thanks,
Dave