Reuse PlotSize stream if it exists
@@ -488,6 +488,11 @@ class ElementPlot(BokehPlot, GenericElementPlot):
if self.dynamic and aspect_props['match_aspect']:
# Sync the plot size on dynamic plots to support accurate
# scaling of dimension ranges
+ plot_size = [s for s in self.streams if isinstance(s, PlotSize)]
+ if plot_size:
+ stream = plot_size[0]
+ stream.add_subscriber(self._update_size)
+ else:
stream = PlotSize(subscribers=[self._update_size])
self.callbacks.append(PlotSizeCallback(self, [stream], None))
