Skip to content
This repository has been archived by the owner on Oct 26, 2019. It is now read-only.

Output widget and interactive matplotlib #322

Open
fhgd opened this issue May 3, 2017 · 1 comment
Open

Output widget and interactive matplotlib #322

fhgd opened this issue May 3, 2017 · 1 comment

Comments

@fhgd
Copy link

fhgd commented May 3, 2017

How to embed an interactive matplotlib figure into an Output widget?

%matplotlib notebook
import matplotlib.pylab as plt

from IPython.display import display
from ipywidgets import Output

out = Output()
with out:
    print('inside top')
    plt.ioff()
    fig, axs = plt.subplots()
    display(fig)
    print('inside bottom')
out.layout.border = '1.5px solid'
display(out)

I just get

grafik

When I use %matplotlib notebook then I get a static matplotlib-figure where I can't zoom:

grafik

I want to have both :-)

@akhmerov
Copy link
Member

akhmerov commented Aug 11, 2017

I'm not sure if it's possible without compromising security: matplotlib output allows for arbitrary communication with the kernel, and the dashboard server should allow only a safe subset of messages.

EDIT: however an output widget even with arbitrary js should be possible.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants