Skip to content

Commit

Permalink
Fixes for bokeh axis handling
Browse files Browse the repository at this point in the history
  • Loading branch information
philippjfr committed Jan 17, 2017
1 parent 8e67b33 commit 868747d
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions holoviews/plotting/bokeh/element.py
Original file line number Diff line number Diff line change
Expand Up @@ -407,7 +407,7 @@ def _title_properties(self, key, plot, element):
def _init_axes(self, plot):
if self.xaxis is None:
plot.xaxis.visible = False
elif self.xaxis == 'top':
elif 'top' in self.xaxis:
plot.above = plot.below
plot.below = []
plot.xaxis[:] = plot.above
Expand All @@ -416,15 +416,15 @@ def _init_axes(self, plot):

if self.yaxis is None:
plot.yaxis.visible = False
elif self.yaxis == 'right':
elif 'right' in self.yaxis:
plot.right = plot.left
plot.left = []
plot.yaxis[:] = plot.right
self.handles['yaxis'] = plot.yaxis[0]
self.handles['y_range'] = plot.y_range


def _axis_properties(self, axis, key, plot, dimension,
def _axis_properties(self, axis, key, plot, dimension=None,
ax_mapping={'x': 0, 'y': 1}):
"""
Returns a dictionary of axis properties depending
Expand Down Expand Up @@ -474,6 +474,8 @@ def _update_plot(self, key, plot, element=None):
"""
el = element.traverse(lambda x: x, [Element])
dimensions = el[0].dimensions() if el else el.dimensions()
if not len(dimensions) >= 2:
dimensions = dimensions+[None]
plot.update(**self._plot_properties(key, plot, element))
props = {axis: self._axis_properties(axis, key, plot, dim)
for axis, dim in zip(['x', 'y'], dimensions)}
Expand Down

0 comments on commit 868747d

Please sign in to comment.