On Apr 28, 2017, at 01:14, Inti Garcés <[email protected]> wrote:
show() works for me drawing the first line graph for value=250, it is the slider that doesn't work
El viernes, 28 de abril de 2017, 5:37:20 (UTC+2), Tyler Nickerson escribió:
When show() is used with output_file()/output_notebook() to render a plot Bokeh creates html and javascript to render the the plot. This output is completely independent of your python code once it is rendered and doesn't have access to the python runtime environment.
You can add CustomJS callbacks to this kind of output, read about them here. However, if you want your callbacks to have access to the same environment as your python code, you will have to use Bokeh server which you can read more about here.
Hope that helps,
Tyler
On Thu, Apr 27, 2017 at 1:17 PM, <[email protected]> wrote:
Hi, first line is ok, but...why nothing happens when I change slide value? Some help please! (rotateimg is an 480x360 array). It seems like update_line function doesn't work...
output_notebook()
TOOLS="pan, box_zoom, reset, save, crosshair"
slider = Slider(start=1, end=360, value=250, step=1)
# Original dataset
x = np.arange(0,len(rotateimg),1)
y = [img[slider.value][i] for i in xrange(len(x))]
print(len(x))
print(len(y))
# create a new plot with a title and axis labels
p = figure(title="Brillo en una línea de la imagen", x_axis_label='x', y_axis_label='Brillo',tools=
TOOLS)
figline = p.line(x, y, line_width=2)
def update_line(attr, old, new):
x = np.arange(0,len(rotateimg),1)
new_y = [img[slider.value][i] for i in xrange(len(x))]
figline.data_source.data['y'] = new_y
slider.on_change('value', update_line)
layout = row(
widgetbox(slider),
p
)
#output_file("slider.html", title="slider.py example")
show(layout)
#
--
You received this message because you are subscribed to the Google Groups "Bokeh Discussion - Public" group.
To unsubscribe from this group and stop receiving emails from it, send an email to bokeh+un...@continuum.io.
To post to this group, send email to bo...@continuum.io.
To view this discussion on the web visit https://groups.google.com/a/continuum.io/d/msgid/bokeh/b1adfc79-9d7e-4c8d-aaf7-1efda6cbb518%40continuum.io\.
For more options, visit https://groups.google.com/a/continuum.io/d/optout\.
--
You received this message because you are subscribed to the Google Groups "Bokeh Discussion - Public" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit https://groups.google.com/a/continuum.io/d/msgid/bokeh/9d24a559-6731-4279-acca-e5efe6acf6ca%40continuum.io\.
For more options, visit https://groups.google.com/a/continuum.io/d/optout\.