<jupyter_start><jupyter_text>Figure examples  figure.bbandsplots Bollinger Bands<jupyter_code>from yahoofinancials import YahooFinancials as YF
import numpy as np
import pandas as pd
import bokelper as bkh

# prepare a dataframe for plotting
symbol = 'JPY=X'
rawdata = YF(symbol).get_historical_price_data(
    '2018-01-01','2018-12-31', 'daily')[symbol]['prices']
df = pd.DataFrame(rawdata)
df.index = pd.to_datetime(df.formatted_date)

# plot
bkh.output_notebook()
fig = bkh.figure(plot_width = 800, plot_height = 400,x_axis_type='datetime',
                y_range=(100, 120))
fig.bbands(df.close, window = 20)
fig.candle(df)
fig.legend.click_policy = 'mute'
bkh.show(fig)<jupyter_output><empty_output><jupyter_text>figure.candleplots a candle chart<jupyter_code>from yahoofinancials import YahooFinancials as YF
import numpy as np
import pandas as pd
import bokelper as bkh

# prepare a dataframe for plotting
symbol = 'JPY=X'
rawdata = YF(symbol).get_historical_price_data(
    '2018-01-01','2018-12-31', 'daily')[symbol]['prices']
df = pd.DataFrame(rawdata)
df.index = pd.to_datetime(df.formatted_date)

# plot
bkh.output_notebook()

fig1 = bkh.figure(plot_width=800, plot_height=500, x_axis_type='datetime',
                  x_range=(df.index[-75], df.index[-1]),
                  y_range=(df.low[-75:].min() * 0.98, df.high[-25:].max() * 1.02),
                  toolbar_location='above',
                 )
fig1.candle(df)

fig2 = bkh.figure(plot_width=800, plot_height=100, x_axis_type='datetime',
                  toolbar_location=None,
                 )
fig2.line(df.index, (df.high + df.low)/2)
fig2.add_tools(bkh.RangeTool(x_range=fig1.x_range, y_range=fig1.y_range))

bkh.show(bkh.Column(fig1, fig2))<jupyter_output><empty_output><jupyter_text>figure.hist<jupyter_code>from yahoofinancials import YahooFinancials as YF
import numpy as np
import pandas as pd
import bokelper as bkh

# prepare a dataframe for plotting
symbol = 'JPY=X'
rawdata = YF(symbol).get_historical_price_data(
    '2018-01-01','2018-12-31', 'daily')[symbol]['prices']
df = pd.DataFrame(rawdata)
df.index = pd.to_datetime(df.formatted_date)

bkh.output_notebook()

fig = bkh.figure(plot_width=800, plot_height=500)

price_moving_band = (df.high - df.low) / df.open * 100
fig.hist(price_moving_band)

bkh.show(fig)<jupyter_output><empty_output><jupyter_text>figure.grayscale<jupyter_code>import bokelper as bkh
from sklearn import datasets

bkh.output_notebook()

digits = datasets.load_digits()
fig = bkh.figure(
    plot_width=100, plot_height=150,
    toolbar_location=None,
    tooltips=[("x", "$x"), ("y", "$y"), ("value", "@image")])
fig.grayscale(digits['data'][0].reshape(8, 8), 4)
bkh.show(fig)<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.14107274063188832, 'fraction_numerical': 0.0426157237325496, 'mean_word_length': 4.9195652173913045, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 17, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '4', 'dir': 'jupyter-structured-clean-dedup', 'id': '508885', 'license': 'MIT', 'n_tokens_mistral': 1141, 'n_tokens_neox': 1034, 'n_words': 182, 'path': 'notebooks/figure.ipynb', 'repo_name': 'boarnasia/bokelper', 'size': '2722'}