bokeh.models Interfacebokeh.models.annotationsbokeh.models.axesbokeh.models.callbacksbokeh.models.formattersbokeh.models.glyphsbokeh.models.gridsbokeh.models.map_plotsbokeh.models.mappersbokeh.models.markersbokeh.models.plotsbokeh.models.rangesbokeh.models.renderersbokeh.models.sourcesbokeh.models.tickersbokeh.models.toolsbokeh.models.widgetbokeh.models.widgets.buttonsbokeh.models.widgets.dialogsbokeh.models.widgets.groupsbokeh.models.widgets.iconsbokeh.models.widgets.inputsbokeh.models.widgets.layoutsbokeh.models.widgets.markupsbokeh.models.widgets.panelsbokeh.models.widgets.tablesbokeh.validation Package
bokeh.plotting Interfacebokeh.charts Interface
< ggplot_line | back to Gallery | xkcd_density >
from ggplot import aes, geom_step, ggplot
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
from bokeh import mpl
from bokeh.plotting import output_file, show
df = pd.DataFrame({
    "x": range(100),
    "y": np.random.choice([-1, 1], 100)
})
df.y = df.y.cumsum()
g = ggplot(aes(x='x', y='y'), data=df) + geom_step()
g.draw()
plt.title("Step ggplot-based plot in Bokeh.")
output_file("step.html")
show(mpl.to_bokeh())