Skip to content

Commit

Permalink
Merge pull request #119 from daft-dev/bugfix
Browse files Browse the repository at this point in the history
fix bug when savefig() is called before render()
  • Loading branch information
dsfulf committed Apr 7, 2020
2 parents 119c323 + ce47ebe commit 5c57191
Show file tree
Hide file tree
Showing 12 changed files with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions daft.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ def __init__(
label_params=label_params,
dpi=dpi,
)
self.figure = None

def add_node(
self,
Expand Down Expand Up @@ -462,6 +463,8 @@ def savefig(self, fname, *args, **kwargs):
"""
kwargs["bbox_inches"] = kwargs.get("bbox_inches", "tight")
kwargs["dpi"] = kwargs.get("dpi", self._dpi)
if not self.figure:
self.render()
self.figure.savefig(fname, *args, **kwargs)


Expand Down
Binary file modified docs/_static/examples/astronomy-thumb.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/_static/examples/classic-thumb.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/_static/examples/deconvolution-thumb.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/_static/examples/exoplanets-thumb.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/_static/examples/fixed-thumb.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/_static/examples/mrf-thumb.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/_static/examples/nocircles-thumb.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/_static/examples/nogray-thumb.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/_static/examples/recursive-thumb.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/_static/examples/weaklensing-thumb.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/_static/examples/wordy-thumb.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 5c57191

Please sign in to comment.