Added flag to disable option propagation
@@ -547,7 +547,11 @@ class GenericElementPlot(DimensionedPlot):
# plot and a 'batched' method to draw multiple Elements at once
_plot_methods = {}
+ # Declares the options that are inherited from sub-elements of the
+ # plot, mostly useful for inheriting options from individual
+ # Elements on an OverlayPlot. Enabled by default in v1.7.
_inherited_options = []
+ v17_option_propagation = True
def __init__(self, element, keys=None, ranges=None, dimensions=None,
batched=False, overlaid=0, cyclic_index=0, zorder=0, style=None,
@@ -575,7 +579,10 @@ class GenericElementPlot(DimensionedPlot):
self.style = self.lookup_options(plot_element, 'style') if style is None else style
plot_opts = self.lookup_options(plot_element, 'plot').options
- inherited = self._traverse_options(plot_element, 'plot', self._inherited_options, defaults=False)
+ if self.v17_option_propagation:
+ inherited = self._traverse_options(plot_element, 'plot',
+ self._inherited_options,
+ defaults=False)
plot_opts.update(**{k: v[0] for k, v in inherited.items()})
dynamic = False if not isinstance(element, DynamicMap) or element.sampled else element.mode
