<jupyter_start><jupyter_text>Bokeh<jupyter_code>from bokeh.io import output_notebook, show, curdoc
output_notebook()
x = [1, 2, 3, 4, 5]
y = [6, 7, 2, 4, 5]<jupyter_output><empty_output><jupyter_text>Courbe<jupyter_code>from bokeh.io import curdoc
from bokeh.plotting import figure

# apply theme to current document
curdoc().theme = "dark_minimal"

# create a plot
p = figure(title='Theme: dark minimal', plot_height=250)

# add a renderer
p.line(x, y)

# show the results
show(p)
p.circle(x, y, color='red', size=20)
show(p)
# chage plot size
p.plot_width = 300
p.plot_height = 300
show(p)
# create a plot
p = figure(title='Theme: dark minimal', 
           y_range=(0, 8),
           x_range=(0, 6),
           plot_height=250)

p.line(x, y)
p.circle(x, y, color='red', size=20)
show(p)
p.y_range
p.x_range<jupyter_output><empty_output><jupyter_text>Axes logarithmique<jupyter_code># prepare some data
x = [0.1, 0.5, 1.0, 1.5, 2.0, 2.5, 3.0]
y0 = [i**2 for i in x]
y1 = [10**i for i in x]

# create a new plot with a logarithmic axis type
p = figure(
    title="Logarithmic axis",
    plot_height=300,
    y_axis_type="log",
)

# add some renderers
p.line(x, x, legend_label="y=x")
p.circle(x, x, legend_label="y=x", fill_color="white", size=8)
p.line(x, y0, legend_label="y=x^2", line_width=3)
p.line(x, y1, legend_label="y=10^x", line_color="red")

show(p)<jupyter_output><empty_output><jupyter_text>Grille<jupyter_code>x = [1, 2, 3, 4, 5]
y = [4, 5, 5, 7, 2]

p = figure(
    title="Customized grid lines example",
    sizing_mode="stretch_width",
    max_width=500,
    plot_height=250,
)

# add a renderer
p.line(x, y, line_color="green", line_width=2)

# change just some things about the x-grid
p.xgrid.grid_line_color = "red"
p.xgrid.grid_line_width = 5


# change just some things about the y-grid
p.ygrid.grid_line_alpha = 0.8
p.ygrid.grid_line_dash = [6, 4]
show(p)
# create a plot
p = figure(
    title='Bandes de couleurs',
    sizing_mode="stretch_width",
    max_width=500,
    plot_height=250,
    background_fill_color='white'
)

# add a renderer
p.line(x, y, line_color="green", line_width=2)

# add bands to the y-grid
p.ygrid.band_fill_color = "olive"
p.ygrid.band_fill_alpha = 0.1


p.xgrid.bounds = (2, 4)
show(p)
p.title="Couleur d'arrièrefond"
p.background_fill_color = (204, 255, 255)
p.border_fill_color = (102, 204, 255)
p.outline_line_color = (0, 0, 255)

# show the results
show(p)<jupyter_output><empty_output><jupyter_text>Barre d'outil<jupyter_code>p.title="Barre d'outils"
p.background_fill_color = 'white'
p.border_fill_color = 'lightblue'
p.toolbar_location='below'
show(p)
p.title="Masqer la barre d'outils"
p.toolbar.autohide = True
p.toolbar.logo = None
show(p)<jupyter_output><empty_output><jupyter_text>Tool tips<jupyter_code>from bokeh.models.tools import HoverTool

p = figure(
    toolbar_location=None,
    tools=[HoverTool()],
    tooltips="Data point @x has the value @y",
    sizing_mode="stretch_width",
    plot_height=250,
    max_width=400
)

p.line(x, y, line_width=2)
p.circle(x, y, size=20, color='red')
show(p)<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.14945125887669464, 'fraction_numerical': 0.040025823111684955, 'mean_word_length': 4.925430210325048, 'pattern_counts': {'":': 0, '<': 25, '<?xml version=': 0, '>': 25, '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': '6', 'dir': 'jupyter-structured-clean-dedup', 'id': '415676', 'license': 'MIT', 'n_tokens_mistral': 1397, 'n_tokens_neox': 1302, 'n_words': 287, 'path': 'doc/bokeh/bokeh2.ipynb', 'repo_name': 'rasql/edunum', 'size': '3098'}