Repository: bokeh/bokeh

Issue:
multi_line does not work with categorical plots
#### ALL software version info (bokeh, python, notebook, OS, browser, any other relevant packages)

Testing with Python 2.7.14 and bokeh==0.12.13.

#### Description of expected behavior and the observed behavior

`multi_line` stopped working with categorical plots.

#### Complete, minimal, self-contained example code that reproduces the issue

```python
    x_range = ['a', 'b', 'c', 'd']
    y_values = [1., 2., 3., 4.]
    y_errors = [.1, .2, .3, .4]


    plot = figure(x_range=x_range)
    plot.square(x_range, y_values, size=7, line_alpha=0)

    err_xs = []
    err_ys = []

    for x, y, yerr in zip(x_range, y_values, y_errors):
        err_xs.append((x, x))
        err_ys.append((y - yerr, y + yerr))

    # Option A: Does not work
    # plot.multi_line(err_xs, err_ys)

    # Option B: works!
    for i in xrange(len(err_xs)):
        plot.line(err_xs[i], err_ys[i])
```

Full example in the example repo: https://github.com/sashabaranov/bokeh-leak-example/tree/0.12.13-categorical-multiline

#### Stack traceback and/or browser JavaScript console output

```
[Error] TypeError: undefined is not an object (evaluating 'this._mapping[t[0]].mapping[t[1]]')
	_lookup (bokeh-0.12.13.min.js:1:364819)
	synthetic (bokeh-0.12.13.min.js:1:363563)
	(anonymous function) (bokeh-0.12.13.min.js:1:363701)
	v_synthetic (bokeh-0.12.13.min.js:1:363720)
	set_data (bokeh-0.12.13.min.js:1:235081)
	set_data (bokeh-0.12.13.min.js:1:370298)
	initialize (bokeh-0.12.13.min.js:1:368764)
	e (bokeh-0.12.13.min.js:1:89638)
	e (bokeh-0.12.13.min.js:1:16917)
	e (bokeh-0.12.13.min.js:1:379500)
	e (bokeh-0.12.13.min.js:1:367663)
	build_views (bokeh-0.12.13.min.js:1:14204)
	build_levels (bokeh-0.12.13.min.js:1:345564)
	initialize (bokeh-0.12.13.min.js:1:338801)
	e (bokeh-0.12.13.min.js:1:89638)
	e (bokeh-0.12.13.min.js:1:16917)
	e (bokeh-0.12.13.min.js:1:337113)
	build_views (bokeh-0.12.13.min.js:1:14204)
	build_child_views (bokeh-0.12.13.min.js:1:300626)
	initialize (bokeh-0.12.13.min.js:1:297635)
	e (bokeh-0.12.13.min.js:1:89638)
	e (bokeh-0.12.13.min.js:1:16917)
	e (bokeh-0.12.13.min.js:1:297426)
	e (bokeh-0.12.13.min.js:1:329848)
	i (bokeh-0.12.13.min.js:1:110551)
	add_model_standalone (bokeh-0.12.13.min.js:1:111137)
	r (bokeh-0.12.13.min.js:1:114436)
	(anonymous function) (bokeh-0.12.13.min.js:1:113719)
```




Discussion:
From the other issue: 

> The issues seems to be that set_data in the patches view is calling v_synthetic on the entire array of arrays, but I'm pretty sure it needs to loop over the outer array and call v_synthetic on the subarrays instead.

Resolving patch:
diff --git a/examples/integration/glyphs/categorical_multi_glyphs.py b/examples/integration/glyphs/categorical_multi_glyphs.py
new file mode 100644
--- /dev/null
+++ b/examples/integration/glyphs/categorical_multi_glyphs.py
@@ -0,0 +1,43 @@
+from bokeh.plotting import figure
+from bokeh.layouts import row, column
+from bokeh.io import show
+
+x_range = ['a', 'b', 'c', 'd']
+y_values = [1., 2., 3., 4.]
+y_errors = [.1, .2, .3, .4]
+
+err_xs = []
+err_ys = []
+
+for x, y, yerr in zip(x_range, y_values, y_errors):
+    err_xs.append((x, x))
+    err_ys.append((y - yerr, y + yerr))
+
+p1 = figure(x_range=x_range, title="multi_line", plot_width=300, plot_height=300)
+p1.square(x_range, y_values, size=7, line_alpha=0)
+
+p1.multi_line(err_xs, err_ys)
+
+p2 = figure(x_range=x_range, title="line", plot_width=300, plot_height=300)
+p2.square(x_range, y_values, size=7, line_alpha=0)
+for i in range(len(err_xs)):
+    p2.line(err_xs[i], err_ys[i])
+
+
+patch1_x = ['foo','bar','bar','foo']
+patch1_y = [1,1,2,2]
+
+patch2_x = ['bar','ting','bar','foo']
+patch2_y = [2,2,4,4]
+
+patch_list_x = [patch1_x, patch2_x]
+patch_list_y = [patch1_y, patch2_y]
+
+p3 = figure(x_range=['foo', 'bar', 'ting'], y_range=(0, 5), title="patches", plot_width=300, plot_height=300)
+p3.patches(patch_list_x, patch_list_y)
+
+p4 = figure(x_range=['foo', 'bar', 'ting'], y_range=(0, 5), title="patch", plot_width=300, plot_height=300)
+p4.patch(patch1_x, patch1_y)
+p4.patch(patch2_x, patch2_y)
+
+show(column(row(p1, p2), row(p3, p4)))


Test patch: