Advertisement
Guest User

Untitled

a guest
Jan 28th, 2016
115
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.84 KB | None | 0 0
  1. from bokeh.plotting import figure, curdoc
  2. from bokeh.models.widgets import Panel, Tabs
  3. from bokeh.client import push_session
  4.  
  5. import numpy as np
  6.  
  7. tabs = []
  8.  
  9. x = np.linspace(-2*np.pi, 2*np.pi, 200)
  10.  
  11. colour_list = [(51, 153, 51) ,(153, 51, 51), (51, 51, 153), (153, 51,153 ), (153, 51, 51)]
  12.  
  13. y = np.sin(x)
  14. w = np.cos(x)
  15.  
  16. z = np.arcsin(x)
  17. u = np.arccos(x)
  18.  
  19. v = np.arctan(x)
  20. r = np.tan(x)
  21.  
  22. list_of_axis = [(y,w), (z, u), (v,r)]
  23.  
  24.  
  25. for two in list_of_axis:
  26.  
  27.     figure_obj = figure(plot_width = 1000, plot_height = 800)  
  28.     figure_obj.line(x, two[0], line_width = 2, line_color = colour_list[3])
  29.     figure_obj.line(x, two[1], line_width = 2, line_color = colour_list[1])
  30.  
  31.     tabs.append(Panel(child = figure_obj, title = "two by two"))
  32.  
  33. tabs = Tabs(tabs = tabs)
  34. session = push_session(curdoc(), url = "http://localhost:1027")
  35. session.show()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement