Skip to content

Commit

Permalink
Fixes for initialization of overlays returned from DynamicMaps
Browse files Browse the repository at this point in the history
  • Loading branch information
philippjfr committed Feb 10, 2016
1 parent 738c1eb commit a574287
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
6 changes: 5 additions & 1 deletion holoviews/plotting/bokeh/element.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
mpl = None
import param

from ...core import Store, HoloMap, Overlay, DynamicMap
from ...core import Store, HoloMap, Overlay, DynamicMap, CompositeOverlay
from ...core import util
from ...element import RGB
from ..plot import GenericElementPlot, GenericOverlayPlot
Expand Down Expand Up @@ -686,6 +686,7 @@ def _init_tools(self, element):

def initialize_plot(self, ranges=None, plot=None, plots=None):
key = self.keys[-1]
element = self._get_frame(key)
ranges = self.compute_ranges(self.hmap, key, ranges)
if plot is None and not self.tabs:
plot = self._init_plot(key, ranges=ranges, plots=plots)
Expand All @@ -705,6 +706,9 @@ def initialize_plot(self, ranges=None, plot=None, plots=None):
title = ', '.join([d.pprint_value_string(k) for d, k in
zip(self.hmap.last.kdims, key)])
panels.append(Panel(child=child, title=title))
if isinstance(element, CompositeOverlay):
frame = element.get(key, None)
subplot.current_frame = frame

if self.tabs:
self.handles['plot'] = Tabs(tabs=panels)
Expand Down
7 changes: 5 additions & 2 deletions holoviews/plotting/mpl/element.py
Original file line number Diff line number Diff line change
Expand Up @@ -662,8 +662,11 @@ def initialize_plot(self, ranges=None):
element = self._get_frame(key)

ranges = self.compute_ranges(self.hmap, key, ranges)
for plot in self.subplots.values():
plot.initialize_plot(ranges=ranges)
for k, subplot in self.subplots.items():
subplot.initialize_plot(ranges=ranges)
if isinstance(element, CompositeOverlay):
frame = element.get(k, None)
subplot.current_frame = frame

if self.show_legend:
self._adjust_legend(element, axis)
Expand Down

0 comments on commit a574287

Please sign in to comment.