Skip to content

Commit 6d1917e

Browse files
authored
Merge pull request #10 from slayoo/main
using svg format for inline graphics by default
2 parents 6c69eeb + 3e1ad2b commit 6d1917e

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

atmos_cloud_sim_uj_utils/show_plot.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,15 @@
22

33
from matplotlib import pyplot
44
from IPython.display import display
5+
from IPython.core.interactiveshell import InteractiveShell
6+
from IPython.core.pylabtools import select_figure_formats
57
from atmos_cloud_sim_uj_utils.temporary_file import TemporaryFile
68

79

8-
def show_plot(filename=None, fig=pyplot):
10+
def show_plot(filename=None, fig=pyplot, inline_format='svg'):
911
""" the missing click-to-save-as-pdf button for matplotlib/Jupyter (use instead of *.show()) """
1012
link = save_and_make_link(fig, filename)
13+
select_figure_formats(InteractiveShell.instance(), {inline_format})
1114
pyplot.show()
1215
display(link)
1316

0 commit comments

Comments
 (0)