I’m attempting to define the axis range as categorical once the figure is declared, and I’m running into errors. Here’s my demo code (Bokeh 0.12.6):
from bokeh.plotting import figure, output_file, show
from bokeh.models import FactorRange
factors = [“a”, “b”, “c”, “d”, “e”, “f”, “g”, “h”]
x = [50, 40, 65, 10, 25, 37, 80, 60]
output_file(“categorical.html”)
p = figure()
p.y_range = FactorRange(factors=factors)
circle = p.circle(x, factors, size=15, fill_color=“orange”, line_color=“green”, line_width=3)
show(p)
``
This throws the error “Range FactorRange is incompatible is Scale LinearScale”. If I initially declare the figure as follows, it works:
p = figure(y_range=factors)
``
What am I doing wrong? A more general question might be, is there a general way to update p = figure(foo=bar) after figure() is called?
Thanks for your help! I’ve been stuck on this for days.

