Edit in JSFiddle

// arrays to hold data
var source = new Bokeh.ColumnDataSource({
  data: { x: [Math.random()], y: [Math.random()] }

// make the plot and add some tools
var tools = "pan,crosshair,wheel_zoom,box_zoom,reset,save";

var plot = Bokeh.Plotting.figure({title:'Example of Random data', tools: tools, height: 300, width: 300});

var scatterData = plot.line({ field: "x" }, { field: "y" }, {
  source: source,
  line_width: 2

// Show the plot, appending it to the end of the current
// section of the document we are in.
Bokeh.Plotting.show(plot, document.getElementById('myplot'));

function addPoint() {
  // The data can be added, but generally all fields must be the
  // same length.
  // Also, the DataSource object must be notified when it has changed.

<div id="myplot" />

<button onclick="addPoint()">Add some data!</button>



External resources loaded into this fiddle: