Combining multiple Charts in one Plot/Figure

Is it possible to combine two bokeh.charts.Chart instances (e.g., a Bar chart and a Step chart) in one figure? The API doesn’t seem a way to do this. Ist it maybe possible to get the glyphs out of a chart instance and put them into another figure?

Like:

bar = bokeh.charts.Bar(datab)
step = bokeh.charts.Step(datas)
fig = bokeh.plotting.figure()
fig.add_glyphs(bar.get_glyphs())
fig.add_glyphs(step.get_glyphs())
bokeh.plotting.show(fig)

Otherwise, I guess I’d have to use the lower level API provided by bokeh.plotting.figure().

Answered on SO:

  python - Multiple charts in one figure in Bokeh - Stack Overflow
Bryan

···

On Mar 17, 2015, at 3:03 PM, [email protected] wrote:

Is it possible to combine two bokeh.charts.Chart instances (e.g., a Bar chart and a Step chart) in one figure? The API doesn’t seem a way to do this. Ist it maybe possible to get the glyphs out of a chart instance and put them into another figure?

Like:

bar = bokeh.charts.Bar(datab)
step = bokeh.charts.Step(datas)
fig = bokeh.plotting.figure()
fig.add_glyphs(bar.get_glyphs())
fig.add_glyphs(step.get_glyphs())
bokeh.plotting.show(fig)

Otherwise, I guess I’d have to use the lower level API provided by bokeh.plotting.figure().

--
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/95857ca8-ab4d-46ea-a58d-3672bdadca02%40continuum.io\.
For more options, visit https://groups.google.com/a/continuum.io/d/optout\.

In addition to what Bryan proposed, if your question is related to the specific case where you want to overlap the 2 charts (bar and step) on the same figure (so vplot, hplot and griplot are not a good fit for you) then the answer no. You cannot easily overlap the 2 charts. In that caseI’d suggest you to use plotting API instead for the moment. The last changes in the charts API have been heading in the direction of making it easier in the future but it’s not there yet.

Fabio

···

On Tuesday, March 17, 2015 at 9:29:13 PM UTC+1, Bryan Van de ven wrote:

Answered on SO:

    [http://stackoverflow.com/questions/28754208/multiple-charts-in-one-figure-in-bokeh](http://stackoverflow.com/questions/28754208/multiple-charts-in-one-figure-in-bokeh)

Bryan

On Mar 17, 2015, at 3:03 PM, [email protected] wrote:

Is it possible to combine two bokeh.charts.Chart instances (e.g., a Bar chart and a Step chart) in one figure? The API doesn’t seem a way to do this. Ist it maybe possible to get the glyphs out of a chart instance and put them into another figure?

Like:

bar = bokeh.charts.Bar(datab)

step = bokeh.charts.Step(datas)

fig = bokeh.plotting.figure()

fig.add_glyphs(bar.get_glyphs())

fig.add_glyphs(step.get_glyphs())

bokeh.plotting.show(fig)

Otherwise, I guess I’d have to use the lower level API provided by bokeh.plotting.figure().

In addition to what Bryan proposed, if your question is related to the specific case where you want to overlap the 2 charts (bar and step) on the same figure (so vplot, hplot and griplot are not a good fit for you) then the answer no. You cannot easily overlap the 2 charts. In that caseI’d suggest you to use plotting API instead for the moment. The last changes in the charts API have been heading in the direction of making it easier in the future but it’s not there yet.

Okay, I think I can live with that.

Thanks for your reply,
Stefan

···

Am Dienstag, 17. März 2015 22:18:30 UTC+1 schrieb Fabio Pliger:

Fabio

On Tuesday, March 17, 2015 at 9:29:13 PM UTC+1, Bryan Van de ven wrote:

Answered on SO:

    [http://stackoverflow.com/questions/28754208/multiple-charts-in-one-figure-in-bokeh](http://stackoverflow.com/questions/28754208/multiple-charts-in-one-figure-in-bokeh)

Bryan

On Mar 17, 2015, at 3:03 PM, [email protected] wrote:

Is it possible to combine two bokeh.charts.Chart instances (e.g., a Bar chart and a Step chart) in one figure? The API doesn’t seem a way to do this. Ist it maybe possible to get the glyphs out of a chart instance and put them into another figure?

Like:

bar = bokeh.charts.Bar(datab)

step = bokeh.charts.Step(datas)

fig = bokeh.plotting.figure()

fig.add_glyphs(bar.get_glyphs())

fig.add_glyphs(step.get_glyphs())

bokeh.plotting.show(fig)

Otherwise, I guess I’d have to use the lower level API provided by bokeh.plotting.figure().