The following code works nicely from within Spyder as long as ipython is
not used:
""" Example for displaying an interactive diagram in a web-browser. """
import matplotlib
import numpy as np
matplotlib.use('webagg')
import matplotlib.pyplot as plt
X = np.linspace(-np.pi, np.pi, 256, endpoint=True) # create an array from
-pi to pi
COS, SIN = np.cos(X), np.sin(X)
plt.plot(X, COS, label='cos')
plt.plot(X, SIN, label='sin')
plt.show()
On Sunday, December 22, 2013 6:17:14 PM UTC+1, ufechner wrote:
>
> Hello,
>
> matplotlib 1.3.1 offers the fully-featured webagg backend:
> http://matplotlib.org/users/whats_new.html#backends
>
> With this backend you can display interactive plots in a web-browser.
>
> Would it be possible to add dockable windows in Spyder that run a
> web-browser
> and display the output of a matplotlib diagram?
>
> And if this would be possible, what would be the best way to implement
> this?
>
> I would like to have the option to open any number of diagram windows and
> place them anywhere in the GUI.
>
> Questions:
> - could that be done with a plugin?
> - which webbrowser could be used? Is QTWebKit a good choice?
> (see:
> http://codescience.wordpress.com/2011/04/19/very-simple-web-browser-on-pyqt4-and-webkit/)
> - is it neccessary to wait with an implementation of this feature until
> webagg is supported by ipython?
>
> Best regards:
>
> Uwe Fechner
>
--
You received this message because you are subscribed to the Google Groups
"spyder" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/spyderlib.
For more options, visit https://groups.google.com/groups/opt_out.