In [ ]:
import bokeh
bokeh.load_notebook()
In [ ]:
from collections import OrderedDict
import numpy as np
from bokeh.charts import Line
# create some example data
xyvalues = OrderedDict(
python=[2, 3, 7, 5, 26, 221, 44, 233, 254, 265, 266, 267, 120, 111],
pypy=[12, 33, 47, 15, 126, 121, 144, 233, 254, 225, 226, 267, 110, 130],
jython=[22, 43, 10, 25, 26, 101, 114, 203, 194, 215, 201, 227, 139, 160],
)
# create an area chart
line = Line(
xyvalues, title="Area Chart", xlabel='time',
ylabel='memory', notebook=True, legend="top_left"
)
line.show()
In [ ]:
import pandas as pd
# Here is some code to read in some stock data from the Yahoo Finance API
AAPL = pd.read_csv(
"http://ichart.yahoo.com/table.csv?s=AAPL&a=0&b=1&c=2000&d=0&e=1&f=2010",
parse_dates=['Date'])
MSFT = pd.read_csv(
"http://ichart.yahoo.com/table.csv?s=MSFT&a=0&b=1&c=2000&d=0&e=1&f=2010",
parse_dates=['Date'])
IBM = pd.read_csv(
"http://ichart.yahoo.com/table.csv?s=IBM&a=0&b=1&c=2000&d=0&e=1&f=2010",
parse_dates=['Date'])
sxyvalues = OrderedDict(
AAPL=AAPL['Adj Close'],
MSFT=MSFT['Adj Close'],
IBM=IBM['Adj Close'],
)
# create an area chart
line = Line(
sxyvalues, title="Medals",legend="top_left",
ylabel='Performance', notebook=True,
)
line.show()
In [ ]:
# create an area chart
from bokeh.plotting import output_notebook, show
output_notebook()
df = pd.DataFrame(sxyvalues)
line = Line(
df, title="Area Chart", ylabel='Performance', notebook=True,
)
show(line)
In [ ]:
line = Line(
list(sxyvalues.values()), title="Area Chart",
ylabel='Performance', notebook=True, legend="top_left"
)
show(line)
In [ ]: