multi_line with ColumnDatasource?

I’m trying to plot multiple time serie lines with data source from a DataFrame. Say the DataFrame has a datetime column called ‘time’ and some other columns ‘x1’, ‘x2’ , ‘x3’ which I need to plot.

I can’t find an example demonstrating multi_line and DataSource. I tried:

dfSource.data = dfSource.from_df(…)
f1 = figure(plot_width=900, plot_height=400, x_axis_type=‘datatime’)
f1.multi_line([‘time’,‘time’,‘time’], [‘x1’,‘x2’,‘x3’], source = dfSource)

But I got:

BokehDeprecationWarning:
Supplying a user-defined data source AND iterable values to glyph methods is deprecated.

See https://github.com/bokeh/bokeh/issues/2056 for more information.

And nothing plotted. Any idea?

Hi,

The coordinate data for multi_line is a "list of lists", e.g

  source = ColumnDataSource(data=dict(
      xs=[ [1, 2, 3], [4, 5, 6] ],
      ys=[ [2, 2, 4], [7, 8, 9] ]
  ))
        p.multi_line(xs='xs', ys='ys', source=source)

Regarding the warning, as of Bokeh 0.12.3 if you provide any of the glyph fields from an explicit user-supplied data source (as above) then you have to provide *all* of them that way (otherwise very unexpected behaviour could occur).

Thanks,

Bryan

···

On Nov 14, 2016, at 2:29 AM, Jian Huang <[email protected]> wrote:

I'm trying to plot multiple time serie lines with data source from a DataFrame. Say the DataFrame has a datetime column called 'time' and some other columns 'x1', 'x2' , 'x3' which I need to plot.

I can't find an example demonstrating multi_line and DataSource. I tried:

dfSource.data = dfSource.from_df(......)
f1 = figure(plot_width=900, plot_height=400, x_axis_type='datatime')
f1.multi_line(['time','time','time'], ['x1','x2','x3'], source = dfSource)

But I got:

BokehDeprecationWarning:
Supplying a user-defined data source AND iterable values to glyph methods is deprecated.

See https://github.com/bokeh/bokeh/issues/2056 for more information.

And nothing plotted. Any idea?

--
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/9d8fae55-61d2-4f62-a3fe-beb869e43c48%40continuum.io.
For more options, visit https://groups.google.com/a/continuum.io/d/optout.

Thanks. Seems that’s not what I’m looking for, I would rather call p.line() for multiple times then.

在 2016年11月15日星期二 UTC+8上午10:26:48,Bryan Van de ven写道:

···

Hi,

The coordinate data for multi_line is a “list of lists”, e.g

    source = ColumnDataSource(data=dict(

        xs=[ [1, 2, 3], [4, 5, 6] ],
        ys=[ [2, 2, 4], [7, 8, 9] ]

    ))

    p.multi_line(xs='xs', ys='ys', source=source)

Regarding the warning, as of Bokeh 0.12.3 if you provide any of the glyph fields from an explicit user-supplied data source (as above) then you have to provide all of them that way (otherwise very unexpected behaviour could occur).

Thanks,

Bryan

On Nov 14, 2016, at 2:29 AM, Jian Huang [email protected] wrote:

I’m trying to plot multiple time serie lines with data source from a DataFrame. Say the DataFrame has a datetime column called ‘time’ and some other columns ‘x1’, ‘x2’ , ‘x3’ which I need to plot.

I can’t find an example demonstrating multi_line and DataSource. I tried:

dfSource.data = dfSource.from_df(…)

f1 = figure(plot_width=900, plot_height=400, x_axis_type=‘datatime’)

f1.multi_line([‘time’,‘time’,‘time’], [‘x1’,‘x2’,‘x3’], source = dfSource)

But I got:

BokehDeprecationWarning:

Supplying a user-defined data source AND iterable values to glyph methods is deprecated.

See https://github.com/bokeh/bokeh/issues/2056 for more information.

And nothing plotted. Any idea?


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/9d8fae55-61d2-4f62-a3fe-beb869e43c48%40continuum.io.

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