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?
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?
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:
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:
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().