SourceForge logo
SourceForge logo
Menu

matplotlib-devel

From: Fernando P. <fpe...@gm...> - 2009年12月31日 04:40:53
Howdy,
are there fundamental reasons to keep this code around in
backends/__init__.py:use() ?
 if 'matplotlib.backends' in sys.modules:
 if warn: warnings.warn(_use_error_msg)
 return
I am now testing the new IPython gui stuff, and if I comment that out
and call pyplot.switch_backend() when I load mpl (along with the qt
patch I sent earlier), I can hop around backends, at least with Qt4
and Wx:
In [10]: %pylab qt
Welcome to pylab, a matplotlib-based Python environment.
Backend in use: Qt4Agg
For more information, type 'help(pylab)'.
In [11]: run simpleplot.py
In [13]: %pylab wx
Welcome to pylab, a matplotlib-based Python environment.
Backend in use: WXAgg
For more information, type 'help(pylab)'.
In [16]: run simpleplot.py
In [17]: figure()
Out[17]: <matplotlib.figure.Figure object at 0xa311b0c>
In [18]: plot(sin(linspace(0,2*pi,200)**2))
Out[18]: [<matplotlib.lines.Line2D object at 0xa49862c>]
In [19]: %pylab qt
Welcome to pylab, a matplotlib-based Python environment.
Backend in use: Qt4Agg
For more information, type 'help(pylab)'.
In [20]: run simpleplot.py
In [21]: figure()
Out[21]: <matplotlib.figure.Figure object at 0xa64fb2c>
In [22]: plot(sin(linspace(0,2*pi,200)))
Out[22]: [<matplotlib.lines.Line2D object at 0xa67d26c>]
etc...
I see lockups trying to throw Tk or Gtk in the mix, but being able to
switch from Wx to Qt and back would be nice, especially since it would
allow using Mayavi and other enthought apps together with Qt-based
tools. mpl closes open windows on backend switch, but at least you
can go back and forth, which is better than nothing and can be useful
for debugging.
This is still very early/experimental ipython code, I just want to
start getting a feel for the mpl-side of the equation...
Cheers,
f
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.
Thanks for helping keep SourceForge clean.
X





Briefly describe the problem (required):
Upload screenshot of ad (required):
Select a file, or drag & drop file here.
Screenshot instructions:

Click URL instructions:
Right-click on the ad, choose "Copy Link", then paste here →
(This may not be possible with some types of ads)

More information about our ad policies

Ad destination/click URL:

AltStyle によって変換されたページ (->オリジナル) /