In [18]:
import sys
sys.version_info
Out[18]:
sys.version_info(major=3, minor=5, micro=1, releaselevel='final', serial=0)
In [13]:
import numpy as np
print(np)
np.__version__
<module 'numpy' from '/projects/anaconda3/lib/python3.5/site-packages/numpy/__init__.py'>
Out[13]:
'1.10.2'
In [14]:
import bokeh
bokeh.__version__
Out[14]:
'0.10.0'
In [7]:
from bokeh.io import output_notebook, show
output_notebook()
BokehJS successfully loaded.
In [8]:
from bokeh.plotting import figure
import numpy as np

x = np.linspace(0, 4*np.pi, 100)
y = np.sin(x)


plot = figure(title="Sine Function")
plot.xaxis.axis_label='x'
plot.yaxis.axis_label='amplitude'


plot.line(x, y, 
  line_color='blue',
  line_width=2,
  legend='sin(x)')

plot.circle(x, 2*y, 
  fill_color='red',
  line_color='black',
  fill_alpha=0.2,
  size=10,
  legend='2sin(x)')

#line_dash is an aribrary length list of lengths
#alternating in [color, blank, color, ...]
plot.line(x, np.sin(2*x),
  line_color='green',
  line_dash=[10,5,2,5], 
  line_width=2,
  legend='sin(2x)')

show(plot)
In [11]:
from bokeh.sampledata.iris import flowers
flowers.head()
Out[11]:
sepal_length sepal_width petal_length petal_width species
0 5.1 3.5 1.4 0.2 setosa
1 4.9 3.0 1.4 0.2 setosa
2 4.7 3.2 1.3 0.2 setosa
3 4.6 3.1 1.5 0.2 setosa
4 5.0 3.6 1.4 0.2 setosa
In [12]:
from bokeh.charts import Scatter

plot = Scatter(flowers, x='petal_length', y='petal_width',
               color='species',
               legend='top_left', title='Flower Morphology')
show(plot)
/projects/anaconda3/lib/python3.5/site-packages/bokeh/charts/_attributes.py:78: FutureWarning: sort(columns=....) is deprecated, use sort_values(by=.....)
  df = df.sort(columns=columns)
In [ ]: