Skip to content

Commit

Permalink
Merge pull request #58 from scipp/better_image_figs_in_docs
Browse files Browse the repository at this point in the history
Make figure images not blurry in docs
  • Loading branch information
nvaytet authored Oct 27, 2022
2 parents 8092dd5 + 1d75e0e commit 5f3f264
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions src/plopp/graphics/canvas.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,14 +71,7 @@ def __init__(self,

def to_image(self):
from ipywidgets import Image
bounds = self.fig.get_tightbbox(self.fig.canvas.get_renderer()).bounds
width = bounds[2] - bounds[0]
height = bounds[3] - bounds[1]
dpi = self.fig.get_dpi()
return Image(value=fig_to_bytes(self.fig),
width=width * dpi,
height=height * dpi,
format='png')
return Image(value=fig_to_bytes(self.fig), format='png')

def autoscale(self, draw=True):
"""
Expand Down

0 comments on commit 5f3f264

Please sign in to comment.