Wrapper on ``matplotlib.Figure.savefig()`` that sets default image padding using ``bbox_inchaes = tight``. ``*args`` and ``**kwargs`` are passed to `matplotlib.Figure.savefig()`. :param fname: The filename to save as. :param dpi: (optional)
(self, fname, *args, **kwargs)
| 476 | plt.show(*args, **kwargs) |
| 477 | |
| 478 | def savefig(self, fname, *args, **kwargs): |
| 479 | """ |
| 480 | Wrapper on ``matplotlib.Figure.savefig()`` that sets default image |
| 481 | padding using ``bbox_inchaes = tight``. |
| 482 | ``*args`` and ``**kwargs`` are passed to `matplotlib.Figure.savefig()`. |
| 483 | |
| 484 | :param fname: |
| 485 | The filename to save as. |
| 486 | |
| 487 | :param dpi: (optional) |
| 488 | The DPI value to use for saving. |
| 489 | |
| 490 | """ |
| 491 | kwargs["bbox_inches"] = kwargs.get("bbox_inches", "tight") |
| 492 | kwargs["dpi"] = kwargs.get("dpi", self._dpi) |
| 493 | if not self.figure: |
| 494 | self.render() |
| 495 | self.figure.savefig(fname, *args, **kwargs) |
| 496 | |
| 497 | |
| 498 | class Node(object): |