Sorry, as bryan noted
this can work.
A nd
yes the confusion over figure/Figure should also be being cle aned
up
from bokeh.plotting
import Figure, curdoc
from bokeh.models.widgets import Panel, Tabs,
TextInput
from bokeh.client import push_session
from bokeh.io import hplot
from bokeh.palettes import Spectral11
import numpy as np
x = np.linspace(-2*np.pi, 2*np.pi, 200)
colour_list = Spectral11 #[(51, 153, 51) ,(153,
51, 51), (51, 51, 153), (153, 51,153 ), (153, 51,
51)]
y = np.sin(x)
w = np.cos(x)
z = np.arcsin(x)
u = np.arccos(x)
v = np.arctan(x)
r = np.tan(x)
list_of_axis = [(y,w), (z, u), (v,r)]
tabs = []
for two in list_of_axis:
figure_obj = Figure(plot_width = 1000,
plot_height = 800, title = “these are waves”)
figure_obj.line(x, two[0], line_width = 2,
line_color = colour_list[3])
figure_obj.line(x, two[1], line_width = 2,
line_color = colour_list[1])
title = "two by two"
tabs.append(Panel(child=figure_obj,
title=title))
curdoc().add_root(Tabs(tabs=tabs))
···
On 4/18/16 11:27 AM, Bryan Van de Ven
wrote:
There is some previous parts of the API about auto-adding to the current document that turned out to be at odds with the new server. We are working to clean all this up for 0.12 in the near future. In the mean time, here is an updated script that works. Note the "Figure" instead of "figure" and also the explicit "curdoc().add_root" If you are curious there are other discussions of this in the tracker and mailing list with details.
-----
from bokeh.plotting import Figure, curdoc
from bokeh.models.widgets import Panel, Tabs, TextInput
from bokeh.client import push_session
from bokeh.io import hplot
from bokeh.palettes import Spectral11
import numpy as np
tabs = []
x = np.linspace(-2*np.pi, 2*np.pi, 200)
colour_list = Spectral11 #[(51, 153, 51) ,(153, 51, 51), (51, 51, 153), (153, 51,153 ), (153, 51, 51)]
y = np.sin(x)
w = np.cos(x)
z = np.arcsin(x)
u = np.arccos(x)
v = np.arctan(x)
r = np.tan(x)
list_of_axis = [(y,w), (z, u), (v,r)]
def update_title(identity, new):
figure_obj.title = identity
for two in list_of_axis:
figure_obj = Figure(plot_width = 1000, plot_height = 800, title = "these are waves")
figure_obj.line(x, two[0], line_width = 2, line_color = colour_list[3])
figure_obj.line(x, two[1], line_width = 2, line_color = colour_list[1])
#text = TextInput(title="title", value='my sine wave')
#identity = "hello I am plot"
#text.on_change('value', lambda attr, old, new: update_title(identity, new))
tabs.append(Panel(child = figure_obj, title = "two by two"))
tabs = Tabs(tabs = tabs)
curdoc().add_root(tabs)
session = push_session(curdoc())
session.show()
session.loop_until_closed()
On Apr 6, 2016, at 2:33 AM, wrote:
I am having the same issue. On Friday, January 29, 2016 at 9:05:36 AM UTC-7, Robert wrote:
This pastebin shows a script that replicates the problem fredag 29. januar 2016 17.02.20 UTC+1 skrev Robert følgende:
Hi! When creating a bokeh.models.widgets.Tabs element and pushing it by bokeh.client.push_session onto a running bokeh server it displays the plots in a "list" rather than in tabs. Is this a known problem? Thank you for any responses, and your patience
-Robert -- You received this message because you are subscribed to the Google Groups "Bokeh Discussion - Public" group.
To unsubscribe from this group and stop receiving emails from it, send an email to .
To post to this group, send email to .
To view this discussion on the web visit .
For more options, visit .
–
Sarah Bird
Developer, Bokeh
[
![Continuum Analytics](http://docs.continuum.io/_static/img/ContinuumWordmark.png)
](http://continuum.io)
[email protected][email protected]@continuum.iohttps://groups.google.com/a/continuum.io/d/msgid/bokeh/62ed0aa9-dd18-4323-b5ee-913deac1078e%40continuum.iohttps://groups.google.com/a/continuum.io/d/optout