Given the following code which produces variable size rectangles, is it possible to apply one-letter text or labels, that would fill within the content of each rect
object in terms of their height? That is, the letters would span from top to bottom of each rect
object.
import numpy as np
from bokeh.plotting import figure, show
factors = ["foo 123", "bar:0.2", "baz-10"]
x = ["foo 123", "foo 123", "foo 123", "bar:0.2", "bar:0.2", "bar:0.2", "baz-10", "baz-10", "baz-10"]
y = ["foo 123", "bar:0.2", "baz-10", "foo 123", "bar:0.2", "baz-10", "foo 123", "bar:0.2", "baz-10"]
colors = [
"#0B486B", "#79BD9A", "#CFF09E",
"#79BD9A", "#0B486B", "#79BD9A",
"#CFF09E", "#79BD9A", "#0B486B"
]
p= figure(title="Categorical Heatmap", tools="hover",
toolbar_location=None,
x_range=factors, y_range=factors)
p.rect(x, y, color=colors, width=[np.random.random() for x in range(len(x))], height=[np.random.random() for x in range(len(x))])
show(p)
Thank you!