SourceForge logo
SourceForge logo
Menu

matplotlib-users

From: Rein v. d. B. <re...@sc...> - 2007年06月29日 14:39:41
> On 6/29/07, Rein van den Boomgaard <re...@sc...> wrote:
> > thanks for answering. I have seen the examples using the oo mpl api,
> but
> > i would like to use the pylab interface from the shell i'm using
> (also
> > in the wx GUI). I'm aiming at a very simplified matlab like
> interface
> > where the plots apear in the dockable windows.
> 
> You will probably need to write your own modified backend based on
> backend_wx and backend_wxagg, that replaces the new_figure_manager and
> FigureManager code with some custom functionality to use your panes.
> 
> 
OK that is the file that i looked into already. Is the backend
functionality i need really concentrated in only these files?
(amazing..)
I'll give it a try.
BTW is there a design document to get some grasp on the architecture of
matplotlib / pylab? It seems that most documentation concentrates on
describing pylab. Probably most people are using pylab (as i do most of
the time...).
Regards
Rein
From: Matt N. <new...@ca...> - 2007年06月29日 15:17:30
Rein,
I don't think you need to change the wx backend to make a MPL plot
appear in a dockable pane. You can definitely create a wx.Panel and
put a MPL Figure in it such as (untested code):
<untested code snippet>
import wx
import matplotlib
from matplotlib.backends.backend_wxagg import FigureCanvasWxAgg
from matplotlib.figure import Figure
class MyPlotPanel(wx.Panel):
 def __init__(self, parent, **kw):
 wx.Panel.__init__(self, parent, -1, **kw)
 self.fig = Figure(self,(6.0,4.0), dpi=96)
 self.axes = self.fig.add_axes([0.15,0.15,0.75,0.75])
 self.canvas = FigureCanvasWxAgg(self,-1, self.fig)
</untested code snippet>
and then use self.axes.plot() (or other methods) and canvas.draw().
Of course, you'll have to put that Panel someplace. I haven't tried
to make a plot in a dockable window myself, but I'd be surprised if
you couldn't do it.
Take a look at wxmpl http://agni.phys.iit.edu/~kmcivor/wxmpl/
and/or my own PlotPanel code from MPlot:
http://cars9.uchicago.edu/~newville/Python/MPlot/
and/or read http://www.scipy.org/Cookbook/Matplotlib/EmbeddingInWx
for more hints and examples.
Cheers,
--Matt Newville
From: Rein v. d. B. <re...@sc...> - 2007年06月29日 15:23:15
Thanks!
does this also allows the use of the pylab interface? I would like to
use pylab from the command line (in a pycrust shell that i can embed in
a dockable window) and let the figures pop-up in a dockable window too.
But still from the command line use the same commands as i would for
pylab from say ipython.
Regards
Rein
On Fri, 2007年06月29日 at 10:17 -0500, Matt Newville wrote:
> Rein,
> 
> I don't think you need to change the wx backend to make a MPL plot
> appear in a dockable pane. You can definitely create a wx.Panel and
> put a MPL Figure in it such as (untested code):
> 
> <untested code snippet>
> import wx
> import matplotlib
> from matplotlib.backends.backend_wxagg import FigureCanvasWxAgg
> from matplotlib.figure import Figure
> 
> class MyPlotPanel(wx.Panel):
> def __init__(self, parent, **kw):
> wx.Panel.__init__(self, parent, -1, **kw)
> self.fig = Figure(self,(6.0,4.0), dpi=96)
> self.axes = self.fig.add_axes([0.15,0.15,0.75,0.75])
> self.canvas = FigureCanvasWxAgg(self,-1, self.fig)
> 
> </untested code snippet>
> 
> and then use self.axes.plot() (or other methods) and canvas.draw().
> Of course, you'll have to put that Panel someplace. I haven't tried
> to make a plot in a dockable window myself, but I'd be surprised if
> you couldn't do it.
> 
> Take a look at wxmpl http://agni.phys.iit.edu/~kmcivor/wxmpl/
> and/or my own PlotPanel code from MPlot:
> http://cars9.uchicago.edu/~newville/Python/MPlot/
> and/or read http://www.scipy.org/Cookbook/Matplotlib/EmbeddingInWx
> for more hints and examples.
> 
> Cheers,
> 
> --Matt Newville
From: John H. <jd...@gm...> - 2007年06月29日 15:25:53
On 6/29/07, Matt Newville <new...@ca...> wrote:
> I don't think you need to change the wx backend to make a MPL plot
> appear in a dockable pane. You can definitely create a wx.Panel and
> put a MPL Figure in it such as (untested code):
But he wants to use pylab in a shell in his wx environment....
JDH
From: John H. <jd...@gm...> - 2007年06月29日 14:47:47
On 6/29/07, Rein van den Boomgaard <re...@sc...> wrote:
> OK that is the file that i looked into already. Is the backend
> functionality i need really concentrated in only these files?
> (amazing..)
pretty much - - there is a pretty tight segregation between the figure
and the gui.
> BTW is there a design document to get some grasp on the architecture of
> matplotlib / pylab? It seems that most documentation concentrates on
> describing pylab. Probably most people are using pylab (as i do most of
> the time...).
backend_template.py and backend_bases.py are good starting points.
There is a chapter in the user's guide and some resources at
http://matplotlib.sourceforge.net/faq.html#OO
JDH
>
> Regards
> Rein
>
>
> -------------------------------------------------------------------------
> This SF.net email is sponsored by DB2 Express
> Download DB2 Express C - the FREE version of DB2 express and take
> control of your XML. No limits. Just data. Click to get it now.
> http://sourceforge.net/powerbar/db2/
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
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 によって変換されたページ (->オリジナル) /