title: Exporting Bokeh Plots as images
body: <p>I have a piece of sample Python that makes a waterfall visual.
  It uses the bokeh lib</p>
  
  <p>It looks great and works well in Jupyter but when I come to use it in PowerBI I get an error saying that no image was created</p>
  
  <p>the code uses show(p) which seems to open an internet explorer page when I run it in PowerBI</p>
  
  <p>I tried a matplotlib example and it uses :
  my_plot.get_figure().savefig("waterfall.png",dpi=200,bbox_inches='tight')
  is there something similar for bokeh lib ?</p>
  
  <pre class="lang-py prettyprint-override"><code>from bokeh.plotting import figure, show
  from bokeh.io import output_notebook
  from bokeh.models import ColumnDataSource, LabelSet
  from bokeh.models.formatters import NumeralTickFormatter
  import pandas as pd
  
  #output_notebook()
  
  # Create the initial dataframe
  index = ['sales','returns','credit fees','rebates','late charges','shipping']
  data = {'amount': [350000,-30000,-7500,-25000,95000,-7000]}
  df = pd.DataFrame(data=data,index=index)
  
  # Determine the total net value by adding the start and all additional transactions
  net = df['amount'].sum()
  
  df['running_total'] = df['amount'].cumsum()
  df['y_start'] = df['running_total'] - df['amount']
  
  # Where do we want to place the label?
  df['label_pos'] = df['running_total']
  
  df_net = pd.DataFrame.from_records([(net, net, 0, net)],
                                     columns=['amount', 'running_total', 'y_start', 'label_pos'],
                                     index=["net"])
  df = df.append(df_net)
  
  df['color'] = 'grey'
  df.loc[df.amount &lt; 0, 'color'] = 'red'
  df.loc[df.amount &gt; 0, 'color'] = 'green'
  df.loc[df.amount &gt; 300000, 'color'] = 'blue'
  df.loc[df.amount &lt; 0, 'label_pos'] = df.label_pos - 10000
  df["bar_label"] = df["amount"].map('{:,.0f}'.format)
  
  TOOLS = "box_zoom,reset,save"
  source = ColumnDataSource(df)
  p = figure(tools=TOOLS, x_range=list(df.index), y_range=(0, net+40000),
             plot_width=800, title = "Sales Waterfall")
  
  p.segment(x0='index', y0='y_start', x1="index", y1='running_total',
            source=source, color="color", line_width=55)
  
  p.grid.grid_line_alpha=0.3
  p.yaxis[0].formatter = NumeralTickFormatter(format="($ 0 a)")
  p.xaxis.axis_label = "Transactions"
  
  labels = LabelSet(x='index', y='label_pos', text='bar_label',
                    text_font_size="8pt", level='glyph',
                    x_offset=-20, y_offset=0, source=source)
  p.add_layout(labels)
  show(p)
  </code></pre>