Skip to content

Commit

Permalink
Ensure HoloViews matplotlib output uses tight layout (#2920)
Browse files Browse the repository at this point in the history
  • Loading branch information
philippjfr committed Nov 15, 2021
1 parent e79a7b2 commit 92b981a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
5 changes: 4 additions & 1 deletion panel/pane/holoviews.py
Expand Up @@ -259,7 +259,10 @@ def _get_model(self, doc, root=None, parent=None, comm=None):

kwargs = {p: v for p, v in self.param.values().items()
if p in Layoutable.param and p != 'name'}
child_pane = self._panes.get(backend, Pane)(state, **kwargs)
pane_type = self._panes.get(backend, Pane)
if 'tight' in pane_type.param:
kwargs['tight'] = True
child_pane = pane_type(state, **kwargs)
self._update_plot(plot, child_pane)
model = child_pane._get_model(doc, root, parent, comm)
if ref in self._plots:
Expand Down
5 changes: 0 additions & 5 deletions panel/pane/plot.py
Expand Up @@ -216,11 +216,6 @@ def _update(self, ref=None, model=None):
manager.canvas.handle_resize(event)
manager.canvas.draw_idle()

def _imgshape(self, data):
"""Calculate and return image width,height"""
w, h = self.object.get_size_inches()
return int(w*72), int(h*72)

def _data(self):
self.object.set_dpi(self.dpi)
b = BytesIO()
Expand Down

0 comments on commit 92b981a

Please sign in to comment.