Skip to content

Instantly share code, notes, and snippets.

@Day0Dreamer
Created March 2, 2018 06:55
Show Gist options
  • Save Day0Dreamer/03017e3204c44c9b4f8ff9ca2862f37d to your computer and use it in GitHub Desktop.
Save Day0Dreamer/03017e3204c44c9b4f8ff9ca2862f37d to your computer and use it in GitHub Desktop.
class WrapWithBokeh(object):
def __init__(self):
self.plot = figure()
def __enter__(self):
return self.plot
def __exit__(self, exc_type, exc_val, exc_tb):
output_file = output_file_name
show(self.plot)
'''Python list'''
with WrapWithBokeh() as plot:
x = [1, 2, 3, 4, 5]
y = [3, 6, 4, 6, 8]
plot.line(x, y, line_width=3)
plot.circle(x, y, fill_color='white', size=10)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment