<jupyter_start><jupyter_text>Bokeh Image Glyph<jupyter_code>from bokeh.plotting import figure, output_file, show
from bokeh.models import Range1d
from bokeh.models.mappers import ColorMapper
import numpy as np

line_color = '#1f78b4'
fill_color = 'black'
output_file("../../figures/glyph-image.html")

N = 1024
nc = N//2
xx, yy = np.meshgrid(np.arange(N)-nc, np.arange(N)-nc)
img = np.sqrt(xx**2 + yy**2)
p = figure(plot_width=400, plot_height=400)
p.image(x=-nc, y=-nc, image=[img], dw=N, dh=N, palette="Spectral11")
p.x_range = Range1d(-nc, nc, bounds=(-nc, nc))
p.y_range = Range1d(-nc, nc, bounds=(-nc, nc))
show(p)<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.17719568567026195, 'fraction_numerical': 0.03389830508474576, 'mean_word_length': 5.63265306122449, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '149998', 'license': 'MIT', 'n_tokens_mistral': 291, 'n_tokens_neox': 276, 'n_words': 56, 'path': 'visualizations/bokeh/notebooks/glyphs/.ipynb_checkpoints/image-checkpoint.ipynb', 'repo_name': 'martinpeck/apryor6.github.io', 'size': '649'}