☰Read-only archive⌕
Looking for help with Bokeh?

This is a read-only archive. Ask questions and join the conversation on GitHub.

Visit Community Support on GitHub →
Archived discussions · Captured October 28, 2026

ColumnDataSource on keyword argument?

Community Support
bjarthur70
bjarthur70

i’m successfully using ColumnDataSource to dynamically change the ‘y’ of a plot.line(). i would also like to change it’s line_color, which is a keyword argument. the usual pattern with a ColumnDataSource is not working. is there a way? thanks.

⌁   Link to post
Bryan
Bryan

Hi,

Sorry, I don't really understand what it is you are attempting, in terms of actual code, from that description. Providing some real code snippets is the best way to help others help you.

Thanks,

Bryan

···

On Oct 26, 2018, at 08:00, bjarthur70@gmail.com wrote:

i'm successfully using ColumnDataSource to dynamically change the 'y' of a plot.line(). i would also like to change it's line_color, which is a keyword argument. the usual pattern with a ColumnDataSource is not working. is there a way? thanks.

--
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+unsubscribe@continuum.io.
To post to this group, send email to bokeh@continuum.io.
To view this discussion on the web visit https://groups.google.com/a/continuum.io/d/msgid/bokeh/59067a4b-d9cb-485e-b28f-48a4ff8b0f15%40continuum.io\.
For more options, visit https://groups.google.com/a/continuum.io/d/optout\.

⌁   Link to post
bjarthur70
bjarthur70

in a preamble i do this:

wav_source = ColumnDataSource(data=dict(x=, y=))

p_wav.line(‘x’, ‘y’, source=wav_sources)

then later on in a callback i do this:

wav_source.data.update(x=xdata, y=ydata)

how do i change line_color too?

⌁   Link to post
Bryan
Bryan

Hi,

Line only draws one line, so it only has one color. You probably want:

  r = p_wav.line('x', 'y', source=wav_sources)

then later:

  r.glyph.line_color = new_color

If that's not what you are are looking for then more information is needed about exactly what your situation is.

Thanks,

Bryan

···

On Oct 26, 2018, at 09:58, bjarthur70@gmail.com wrote:

in a preamble i do this:

        wav_source = ColumnDataSource(data=dict(x=, y=))
        p_wav.line('x', 'y', source=wav_sources)

then later on in a callback i do this:

        wav_source.data.update(x=xdata, y=ydata)

how do i change line_color too?

--
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+unsubscribe@continuum.io.
To post to this group, send email to bokeh@continuum.io.
To view this discussion on the web visit https://groups.google.com/a/continuum.io/d/msgid/bokeh/4f3a6990-cdcc-4659-b3bc-9a2ab1a11506%40continuum.io\.
For more options, visit https://groups.google.com/a/continuum.io/d/optout\.

⌁   Link to post
Mail_Lists
Mail_Lists

Hi Bryan,

Thanks for getting back to me. In terms of code. Here is what works:

Initialize the source

source = ColumnDataSource(dict(time=np.zeros(10), y= np.zeros(10))

Now use these quantities to plot some figures

fig = figure(… details…)

fig.line(x=‘time’, y=‘y’, source=source)

Now for each iteration in the my update function

def update(t):

···

On Friday, 26 October 2018 11:49:26 UTC-4, Bryan Van de ven wrote:

Hi,

Sorry, I don’t really understand what it is you are attempting, in terms of actual code, from that description. Providing some real code snippets is the best way to help others help you.

Thanks,

Bryan

On Oct 26, 2018, at 08:00, bjart...@gmail.com wrote:

i’m successfully using ColumnDataSource to dynamically change the ‘y’ of a plot.line(). i would also like to change it’s line_color, which is a keyword argument. the usual pattern with a ColumnDataSource is not working. is there a way? thanks.

–
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/59067a4b-d9cb-485e-b28f-48a4ff8b0f15%40continuum.io.

For more options, visit https://groups.google.com/a/continuum.io/d/optout.

⌁   Link to post

End of archived discussion · Replies are disabled