Skip to content

Commit

Permalink
Update outdated MatplotlibWriter Doc (#1579)
Browse files Browse the repository at this point in the history
* update docs

Signed-off-by: noklam <[email protected]>

* fix lint

Signed-off-by: noklam <[email protected]>
  • Loading branch information
noklam authored May 30, 2022
1 parent 8350585 commit 9a651c4
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions kedro/extras/datasets/matplotlib/matplotlib_writer.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,22 +30,24 @@ class MatplotlibWriter(AbstractVersionedDataSet):
>>> from kedro.extras.datasets.matplotlib import MatplotlibWriter
>>>
>>> # Saving single plot
>>> fig = plt.figure()
>>> plt.plot([1, 2, 3], [4, 5, 6])
>>> single_plot_writer = MatplotlibWriter(
>>> filepath="matplot_lib_single_plot.png"
>>> )
>>> plt.close()
>>> single_plot_writer.save(plt)
>>> single_plot_writer.save(fig)
>>>
>>> # MatplotlibWriter can output other formats as well, such as PDF files.
>>> # For this, we need to specify the format:
>>> fig = plt.figure()
>>> plt.plot([1, 2, 3], [4, 5, 6])
>>> single_plot_writer = MatplotlibWriter(
>>> filepath="matplot_lib_single_plot.pdf",
>>> save_args={"format": "pdf"},
>>> )
>>> plt.close()
>>> single_plot_writer.save(plt)
>>> single_plot_writer.save(fig)
>>>
>>> # Saving dictionary of plots
>>> plots_dict = dict()
Expand Down

0 comments on commit 9a651c4

Please sign in to comment.