Then later you can update the range to whatever you like:
p.y_range = [-10, 10]
You will probably then need to store the plot again:
cursession().store_objects(p)
You should also be able create your own Range1d object for the y_range, and then update and store just that instead of the whole plot. Either way should be fine.
Let us know if this does not work for you.
Bryan
···
On Aug 24, 2014, at 2:11 PM, Erik Schweller <[email protected]> wrote:
Setup:
I have a plot that I've started with some initial conditions:
For example (here "charts" is a dynamic structure from my app):
if charts.get('type') == 'bar':
for pkey, kwargs in charts.get('items', {}):
plotting.rect(x=sample['_ops'],
y=[_v / 2.0 for _v in sample[pkey]],
height=sample[pkey], width=0.9,
tools=self.plot_tools,
x_range=sample['_ops'],
y_range=[0, max(sample[pkey]) + 1],
legend=pkey, **kwargs)
plotting.xaxis().major_label_orientation = 3.14 / 3.0
plotting.xaxis().major_label_standoff = 0
plotting.axis().major_label_text_font_size = "7pt"
If I don't set the y_range, the data isn't "sitting" at 0 but the chart correctly automatically updates max values as the run proceeds.
Question:
I cannot figure out how to re-assign the y_range value for charts running in bokeh-server.
I much be missing something basic. I'm currently running with bokeh==0.5.2-49-gf5a107a due to the axis styling issues in bokeh 0.5.2.
Wow, I was making that too complicated! Yet another example of how this project is great.
Thanks!
-Erik
···
On Sunday, August 24, 2014 3:21:42 PM UTC-4, Bryan Van de ven wrote:
Hi Eric,
You should be able to save off the plot:
p = plotting.rect(...)
Then later you can update the range to whatever you like:
p.y_range = [-10, 10]
You will probably then need to store the plot again:
cursession().store_objects(p)
You should also be able create your own Range1d object for the y_range, and then update and store just that instead of the whole plot. Either way should be fine.