I would like to save a holoviews plot as a SVG, however I am getting an error message that I don't understand:
np.random.seed(9)
data = np.random.rand(10, 2)
points = hv.Points(data)
labels = hv.Labels({('x', 'y'): data, 'text': [chr(65+i) for i in range(10)]}, ['x', 'y'], 'text')
overlay = (points * labels).redim.range(x=(-0.2, 1.2), y=(-.2, 1.2))
overlay.opts(
opts.Labels(text_font_size='10pt', xoffset=0.08),
opts.Points(color='black', size=5))
hv.save(overlay, 'overlay.svg', fmt='svg')
---------------------------------------------------------------------------
Exception Traceback (most recent call last)
<ipython-input-29-b23ca97e9c01> in <module>
9 opts.Points(color='black', size=5))
10
---> 11 hv.save(overlay, 'overlay.svg', fmt='svg')
~/miniconda3/envs/mybrew/lib/python3.7/site-packages/holoviews/util/__init__.py in save(obj, filename, fmt, backend, resources, toolbar, title, **kwargs)
818 filename = '.'.join(formats[:-1])
819 return renderer_obj.save(obj, filename, fmt=fmt, resources=resources,
--> 820 title=title)
821
822
~/miniconda3/envs/mybrew/lib/python3.7/site-packages/holoviews/plotting/renderer.py in save(self_or_cls, obj, basename, fmt, key, info, options, resources, title, **kwargs)
592
593 with StoreOptions.options(obj, options, **kwargs):
--> 594 plot, fmt = self_or_cls._validate(obj, fmt)
595
596 if isinstance(plot, Viewable):
~/miniconda3/envs/mybrew/lib/python3.7/site-packages/holoviews/plotting/renderer.py in _validate(self, obj, fmt, **kwargs)
302 if fmt not in all_formats:
303 raise Exception("Format %r not supported by mode %r. Allowed formats: %r"
--> 304 % (fmt, self.mode, fig_formats + holomap_formats))
305 self.last_plot = plot
306 return plot, fmt
Exception: Format 'svg' not supported by mode 'default'. Allowed formats: ['html', 'auto', 'png', 'widgets', 'scrubber', 'gif', 'auto', None]
Would anyone have a clue why this might be happening? According to the docs:
http://holoviews.org/user_guide/Exporting_and_Archiving.html
export to SVG should be possible.