Plotly is not so major compared to bokeh. Since plotly has a fushi that is thought to be an online tool, try drawing candlesticks on Jupyter in a local environment.
Below, all are carried out from Jupyter notebook
from plotly.offline import init_notebook_mode, iplot
from plotly.tools import FigureFactory as FF
import pandas as pd
try:
import Quandl as quandl
except ImportError:
import quandl as quandl
There is plotly.offline, so if you import this, you can use plotly offline. This data is pulled from Quandl, but for some reason the first Q may be uppercase or lowercase depending on the environment, so it's a painstaking measure. (Please tell me who knows the countermeasures)
#Magic for drawing on jupyter
init_notebook_mode()
#Get Nikkei Stock Average from Quadl with Dataframe
df = quandl.get("NIKKEI/INDEX")
#Draw candlestick
fig = FF.create_candlestick(df['Open Price'], df['High Price'], df['Low Price'], df['Close Price'], dates=df.index)
iplot(fig)
The result looks like this ↓
When you actually execute it with Jupyter and move the cursor to the graph, four values are displayed.
Recommended Posts