Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ensure HoloViews matplotlib output uses tight layout #2920

Merged
merged 1 commit into from Nov 15, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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