Repository: bokeh/bokeh

Issue:
Axes labels misplaced on multiple extra_x_ranges
I have tried to add multiple extra_x_ranges on a plot and the labels failed to be placed on the correct position. Probably related to the offset used when more than one extra_x_ranges is used.

I am using python 2.7 with Bokeh 0.12.10
In the example bellow axis label 'foo2' is misplaced over axis foo3 and label 'foo3' is missing.
Code to replicate:
![untitled](https://user-images.githubusercontent.com/33360731/32397602-e17d6f60-c0ea-11e7-96e1-a65122753b40.png)
```
from bokeh.plotting import figure, show
from bokeh.models import Range1d, LinearAxis


plot = figure(title=None, x_axis_location=None, y_axis_location=None)
plot.extra_y_ranges ['MD'] = Range1d(start=0, end=1)
plot.add_layout(LinearAxis(y_range_name='MD', axis_label = 'MD [m]'), 'left')
plot.extra_x_ranges ['foo1'] = Range1d(start=0,end=1)
plot.add_layout(LinearAxis(x_range_name='foo1', axis_label = 'foo1'), 'above')
plot.extra_x_ranges ['foo2'] = Range1d(start=0,end=10)
plot.add_layout(LinearAxis(x_range_name='foo2', axis_label = 'foo2'), 'above')
plot.extra_x_ranges ['foo3'] = Range1d(start=0,end=1)
plot.add_layout(LinearAxis(x_range_name='foo3', axis_label = 'foo3'), 'above')


plot.line(x = [0,1], y = [0,1], legend = 'foo1', x_range_name='foo1', y_range_name='MD')   
plot.line(x = [10,0], y = [0,1], legend = 'foo2', x_range_name='foo2', y_range_name='MD', color='red')   
plot.line(x = [0,0.5], y = [0.5,0], legend = 'foo3', x_range_name='foo3', y_range_name='MD')   

show(plot)
```




Discussion:
cc @mattpap 
This works correctly in PR #7108, so maybe we will have one issue for free.
This also work on `master`.
I would add this example as a test though.
@mattpap can you do this today, or let me know where you want it added and I will do it. 
@mattpap this does not appear to be fixed in master at the moment, I'm seeing exactly the same result as above
This is what I see in Chrome:

![image](https://user-images.githubusercontent.com/27475/34389419-c8ca0a90-eb39-11e7-99d9-5fbf1531ec57.png)

I will submit with a PR later today. Hopefully this isn't a browser-dependent issue.

Resolving patch:
diff --git a/examples/integration/layout/axis_label_extra_x_ranges.py b/examples/integration/layout/axis_label_extra_x_ranges.py
new file mode 100644
--- /dev/null
+++ b/examples/integration/layout/axis_label_extra_x_ranges.py
@@ -0,0 +1,24 @@
+from __future__ import absolute_import
+
+from bokeh.plotting import figure, show
+from bokeh.models import Range1d, LinearAxis
+
+plot = figure(title=None, x_axis_location=None, y_axis_location=None)
+
+plot.extra_y_ranges ['MD'] = Range1d(start=0, end=1)
+plot.add_layout(LinearAxis(y_range_name='MD', axis_label = 'MD [m]'), 'left')
+
+plot.extra_x_ranges ['foo1'] = Range1d(start=0, end=1)
+plot.add_layout(LinearAxis(x_range_name='foo1', axis_label = 'foo1'), 'above')
+
+plot.extra_x_ranges ['foo2'] = Range1d(start=0, end=10)
+plot.add_layout(LinearAxis(x_range_name='foo2', axis_label = 'foo2'), 'above')
+
+plot.extra_x_ranges ['foo3'] = Range1d(start=0, end=1)
+plot.add_layout(LinearAxis(x_range_name='foo3', axis_label = 'foo3'), 'above')
+
+plot.line(x=[0, 1], y=[0, 1], legend = 'foo1', x_range_name='foo1', y_range_name='MD')
+plot.line(x=[10, 0], y=[0, 1], legend = 'foo2', x_range_name='foo2', y_range_name='MD', color='red')
+plot.line(x=[0, 0.5], y=[0.5, 0], legend = 'foo3', x_range_name='foo3', y_range_name='MD')
+
+show(plot)


Test patch:
diff --git a/examples/integration/annotations/test_arrow.py b/examples/integration/annotations/arrow.py
similarity index 100%
rename from examples/integration/annotations/test_arrow.py
rename to examples/integration/annotations/arrow.py
diff --git a/examples/integration/annotations/test_band.py b/examples/integration/annotations/band.py
similarity index 100%
rename from examples/integration/annotations/test_band.py
rename to examples/integration/annotations/band.py
diff --git a/examples/integration/annotations/test_color_bar.py b/examples/integration/annotations/color_bar.py
similarity index 100%
rename from examples/integration/annotations/test_color_bar.py
rename to examples/integration/annotations/color_bar.py
diff --git a/examples/integration/annotations/test_label.py b/examples/integration/annotations/label.py
similarity index 100%
rename from examples/integration/annotations/test_label.py
rename to examples/integration/annotations/label.py
diff --git a/examples/integration/annotations/test_label_set.py b/examples/integration/annotations/label_set.py
similarity index 100%
rename from examples/integration/annotations/test_label_set.py
rename to examples/integration/annotations/label_set.py
diff --git a/examples/integration/annotations/test_legend.py b/examples/integration/annotations/legend.py
similarity index 100%
rename from examples/integration/annotations/test_legend.py
rename to examples/integration/annotations/legend.py
diff --git a/examples/integration/annotations/test_title.py b/examples/integration/annotations/title.py
similarity index 100%
rename from examples/integration/annotations/test_title.py
rename to examples/integration/annotations/title.py
diff --git a/examples/integration/annotations/test_whisker.py b/examples/integration/annotations/whisker.py
similarity index 100%
rename from examples/integration/annotations/test_whisker.py
rename to examples/integration/annotations/whisker.py