@bryevdv says there’s a way to accomplish this, but I can’t find any clues in the docs:
Setting both limits of an axis is easy:
p = figure(x_range=[1, 5])
or p.set(x_range=[1,5])
Setting lower bound only could be done though using (nonexisting) p.get_x_range() but as discussed in #4371 it is not possible to get calculated values of the x_range in python because the calculation is done on the client side.
It’d be great if one could set only one limit manually and let bokeh calculate the other one for example using this notation:
If you want any auto-ranging at all, then the Plot's range objects need to be DataRange1d. These are what are added by default. However, when you provide a tuple (or list) like this:
p = figure(x_range=[1, 5])
That is a just a shorthand convenience or setting a different kind of range object, a Range1d, which does *not* do any sort of auto-ranging. It's just a fixed start and end tuple, basically.
So if you want some auto-ranging, there needs to be a DataRange1d. So there are two options:
* update the default ones that figure creates, or
* create data ranges explicitly by hand
Those two options look roughly like:
p = figure()
p.x_range.start = 1
or
p = figure(x_range=DataRange1d(start=1)
It's conceivable that
p = figure(x_range=[1, None])
could be made to do the above "automagically" however it would first merit some discussion. There's already a way to accomplish it without more "magic" (which is often harder to document).
@bryevdv says there's a way to accomplish this, but I can't find any clues in the docs:
Setting both limits of an axis is easy:
p = figure(x_range=[1, 5])
or p.set(x_range=[1,5])
Setting lower bound only could be done though using (nonexisting) p.get_x_range() but as discussed in #4371 it is not possible to get calculated values of the x_range in python because the calculation is done on the client side.
It'd be great if one could set only one limit manually and let bokeh calculate the other one for example using this notation: