Skip to content

Commit

Permalink
Guard against pdf output in IPython display hooks
Browse files Browse the repository at this point in the history
  • Loading branch information
philippjfr committed Mar 13, 2017
1 parent 26d2072 commit 3c94872
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
8 changes: 7 additions & 1 deletion holoviews/ipython/display_hooks.py
Expand Up @@ -49,7 +49,11 @@ def render(obj, **kwargs):
return render_anim(obj)

backend = Store.current_backend
return Store.renderers[backend].html(obj, **kwargs)
renderer = Store.renderers[backend]
if renderer.fig == 'pdf':
renderer = renderer.instance(fig='png')

return renderer.html(obj, **kwargs)


def single_frame_plot(obj):
Expand Down Expand Up @@ -154,6 +158,8 @@ def element_display(element, max_frames, max_branches):
if type(element) not in Store.registry[backend]:
return None
renderer = Store.renderers[backend]
if renderer.fig == 'pdf':
renderer = renderer.instance(fig='png')
return renderer.html(element, fmt=renderer.fig)


Expand Down
4 changes: 0 additions & 4 deletions holoviews/plotting/mpl/renderer.py
Expand Up @@ -272,10 +272,6 @@ def validate(cls, options):
"""
Validates a dictionary of options set on the backend.
"""
if options['fig']=='pdf':
outputwarning.warning("PDF output is experimental, may not be supported"
"by your browser and may change in future.")

if options['backend']=='matplotlib:nbagg' and options['widgets'] != 'live':
outputwarning.warning("The widget mode must be set to 'live' for "
"matplotlib:nbagg.\nSwitching widget mode to 'live'.")
Expand Down

0 comments on commit 3c94872

Please sign in to comment.