import numpy as np
from bokeh.plotting import *
from bokeh.models import ColumnDataSource
准备数据
N = 300
x = np.linspace(0,4*np.pi, N)
y0 = np.sin(x)
y1 = np.cos(x)
output_notebook()
#create a column data source for the plots to share
source = ColumnDataSource(data = dict(x = x, y0 = y0, y1 = y1))
Tools = "pan, wheel_zoom, box_zoom, reset, save, box_select, lasso_select"
创建一个新的阴谋,并添加渲染
left = figure(tools = Tools, plot_width = 350, plot_height = 350, title = 'sinx')
left.circle(x, y0,source = source)
创建另一个情节,并添加渲染
right = figure(tools = Tools, plot_width = 350, plot_height = 350 , title = 'cosx')
right.circle(x, y1, source = source)
将该子图放入网格图中并显示图
p = gridplot([[left, right]])
show(p)
什么是错与罪图表。不知道为什么“背景虚化”的行为就像this.But如果我写个Y为双人或单引号/引号那么事情做工精细
left.circle(x, 'y0',source = source)
right.circle(x, 'y1', source = source)
把次要情节在gridplot并显示情节
p = gridplot([[left, right]])
show(p)
事情我试图解决重新启动我的笔记本电脑的问题
1)。 (最简单的方法来解决问题)
2)生成输出到新窗口。
3)分别生成的图而不是网格图。
请帮我找出幕后的原因。
我做错了什么? 这是一个错误?