You can subscribe to this list here.
2003 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(3) |
Jun
|
Jul
|
Aug
(12) |
Sep
(12) |
Oct
(56) |
Nov
(65) |
Dec
(37) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2004 |
Jan
(59) |
Feb
(78) |
Mar
(153) |
Apr
(205) |
May
(184) |
Jun
(123) |
Jul
(171) |
Aug
(156) |
Sep
(190) |
Oct
(120) |
Nov
(154) |
Dec
(223) |
2005 |
Jan
(184) |
Feb
(267) |
Mar
(214) |
Apr
(286) |
May
(320) |
Jun
(299) |
Jul
(348) |
Aug
(283) |
Sep
(355) |
Oct
(293) |
Nov
(232) |
Dec
(203) |
2006 |
Jan
(352) |
Feb
(358) |
Mar
(403) |
Apr
(313) |
May
(165) |
Jun
(281) |
Jul
(316) |
Aug
(228) |
Sep
(279) |
Oct
(243) |
Nov
(315) |
Dec
(345) |
2007 |
Jan
(260) |
Feb
(323) |
Mar
(340) |
Apr
(319) |
May
(290) |
Jun
(296) |
Jul
(221) |
Aug
(292) |
Sep
(242) |
Oct
(248) |
Nov
(242) |
Dec
(332) |
2008 |
Jan
(312) |
Feb
(359) |
Mar
(454) |
Apr
(287) |
May
(340) |
Jun
(450) |
Jul
(403) |
Aug
(324) |
Sep
(349) |
Oct
(385) |
Nov
(363) |
Dec
(437) |
2009 |
Jan
(500) |
Feb
(301) |
Mar
(409) |
Apr
(486) |
May
(545) |
Jun
(391) |
Jul
(518) |
Aug
(497) |
Sep
(492) |
Oct
(429) |
Nov
(357) |
Dec
(310) |
2010 |
Jan
(371) |
Feb
(657) |
Mar
(519) |
Apr
(432) |
May
(312) |
Jun
(416) |
Jul
(477) |
Aug
(386) |
Sep
(419) |
Oct
(435) |
Nov
(320) |
Dec
(202) |
2011 |
Jan
(321) |
Feb
(413) |
Mar
(299) |
Apr
(215) |
May
(284) |
Jun
(203) |
Jul
(207) |
Aug
(314) |
Sep
(321) |
Oct
(259) |
Nov
(347) |
Dec
(209) |
2012 |
Jan
(322) |
Feb
(414) |
Mar
(377) |
Apr
(179) |
May
(173) |
Jun
(234) |
Jul
(295) |
Aug
(239) |
Sep
(276) |
Oct
(355) |
Nov
(144) |
Dec
(108) |
2013 |
Jan
(170) |
Feb
(89) |
Mar
(204) |
Apr
(133) |
May
(142) |
Jun
(89) |
Jul
(160) |
Aug
(180) |
Sep
(69) |
Oct
(136) |
Nov
(83) |
Dec
(32) |
2014 |
Jan
(71) |
Feb
(90) |
Mar
(161) |
Apr
(117) |
May
(78) |
Jun
(94) |
Jul
(60) |
Aug
(83) |
Sep
(102) |
Oct
(132) |
Nov
(154) |
Dec
(96) |
2015 |
Jan
(45) |
Feb
(138) |
Mar
(176) |
Apr
(132) |
May
(119) |
Jun
(124) |
Jul
(77) |
Aug
(31) |
Sep
(34) |
Oct
(22) |
Nov
(23) |
Dec
(9) |
2016 |
Jan
(26) |
Feb
(17) |
Mar
(10) |
Apr
(8) |
May
(4) |
Jun
(8) |
Jul
(6) |
Aug
(5) |
Sep
(9) |
Oct
(4) |
Nov
|
Dec
|
2017 |
Jan
(5) |
Feb
(7) |
Mar
(1) |
Apr
(5) |
May
|
Jun
(3) |
Jul
(6) |
Aug
(1) |
Sep
|
Oct
(2) |
Nov
(1) |
Dec
|
2018 |
Jan
|
Feb
|
Mar
|
Apr
(1) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2020 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(1) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2025 |
Jan
(1) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: LUK S. <shu...@po...> - 2003-12-07 08:49:16
|
Hello, I just tried out the wxpython backend from the CVS and it seems to work as advertised, except a small glitch. I had matplotlib installed in another location, not under the default python main tree and use the environmental variable AFMPATH to point to the afm fonts files. The backend_wx(.py) relies on distutils.sysconfig.PREFIX to find the GUI bitmap files. Adding the following 2 lines if os.environ.has_key('AFMPATH'): basedir = os.environ['AFMPATH'] after the line basedir = os.path.join(distutils.sysconfig.PREFIX, 'share', 'matplotlib') in the function _load_bitmap(filename) will enable it to locate the bitmap files which are installed together with the afm font files. (As AFMPATH points to more than font resources, a more appropriate name such as MATPLOTLIBRESOURCE may be warranted, though changing it will break old installations. I'm happy to let it stay as it is.) Regards, ST |
From: Jeremy O'D. <je...@o-...> - 2003-12-02 17:14:17
|
Hi Flavio, I expect that you've found the solution to your problem now, but just in case, I have now published significantly improved version of the wx embedding example in CVS. Since Sourceforge can take some time to sort these things out, I have included the code here. I should also note that there has been quite a significant enhancement to the CVS version of backend_wx committed to CVS. You may wish to use this (although I don't think that the interface has changed anywhere. Details of the changes have been posted to the matplotlib-devel list, or you can see details at the top of the source file (matplotlib-devel archiving appears to be very slow). Regards Jeremy =3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D= 3D=3D3D=3D3D=3D3D=3D3D """ Copyright (C) Jeremy O'Donoghue, 2003 License: This work is licensed under the PSF. A copy should be included with this source code, and is also available at http://www.python.org/psf/license.html This is a sample showing how to embed a matplotlib figure in a wxPanel. The example implements the full navigation toolbar, so you can automatica= =3D lly inherit standard matplotlib features such as the ability to zoom, pan and save figures in the supported formats. There are a few small complexities worth noting in the example: 1) By default, a wxFrame can contain a toolbar (added with SetToolBar()) but this is at the top of the frame. Matplotlib default is to put the controls at the bottom of the frame, so you have to manage the toolbar yourself. I have done this by putting the figure and toolbar into a sizer, but this means that you need to override GetToolBar for your wxFrame so that the figure manager can find the toolbar. 2) I have implemented a figure manager to look after the plots and axes. If you don't want a toolbar, it is simpler to add the figure directly and not worry. However, the figure manager looks after clipping of the figure contents, so you will need it if you want to navigate 3) There is a bug in the way in which my copy of wxPython calculates toolbar width on Win32, so there is a tricky line to ensure that the width of the toolbat is the same as the width of the figure. 4) Depending on the parameters you pass to the sizer, you can make the figure resizable or not. """ import matplotlib matplotlib.use('WX') from matplotlib.backends import Figure, Toolbar, FigureManager from matplotlib.axes import Subplot import Numeric as numpy from wxPython.wx import * class PlotFigure(wxFrame): def __init__(self): wxFrame.__init__(self, None, -1, "Test embedded wxFigure") self.fig =3D3D Figure(self, -1, (5,4), 75) self.toolbar =3D3D Toolbar(self.fig) self.toolbar.Realize() # On Windows, default frame size behaviour is incorrect # you don't need this under Linux tw, th =3D3D self.toolbar.GetSizeTuple() fw, fh =3D3D self.fig.GetSizeTuple() self.toolbar.SetSize(wxSize(fw, th)) # Create a figure manager to manage things self.figmgr =3D3D FigureManager(self.fig, 1, self) # Now put all into a sizer sizer =3D3D wxBoxSizer(wxVERTICAL) # This way of adding to sizer prevents resizing #sizer.Add(self.fig, 0, wxLEFT|wxTOP) # This way of adding to sizer allows resizing sizer.Add(self.fig, 1, wxLEFT|wxTOP|wxGROW) # Best to allow the toolbar to resize! sizer.Add(self.toolbar, 0, wxGROW) self.SetSizer(sizer) self.Fit() def plot_data(self): # Use ths line if using a toolbar a =3D3D self.figmgr.add_subplot(111) # Or this one if there is no toolbar #a =3D3D Subplot(self.fig, 111) t =3D3D numpy.arange(0.0,3.0,0.01) s =3D3D numpy.sin(2*numpy.pi*t) c =3D3D numpy.cos(2*numpy.pi*t) a.plot(t,s) a.plot(t,c) self.toolbar.update() def GetToolBar(self): # You will need to override GetToolBar if you are using an # unmanaged toolbar in your frame return self.toolbar if __name__ =3D3D=3D3D '__main__': app =3D3D wxPySimpleApp() frame =3D3D PlotFigure() frame.plot_data() frame.Show() app.MainLoop() |
From: John H. <jdh...@ac...> - 2003-11-27 17:26:17
|
>>>>> "Nils" == Nils Wagner <nw...@me...> writes: Nils> Hi all, I am wondering, if there is a tutorial (pdf-format) Nils> illustrating all features of matplotlib. There is nothing in pdf format, but there is a tutorial on the web page http://matplotlib.sourceforge.net/tutorial.html It's only a basic introduction, but is enough to get you started. After that the best way to proceed is to look at the examples dir of the source distribution (*.zip or *.tar.gz). Also, the library is matlab compatible, and there is a wealth of documentation for matlab. The reference for the matlab interface is http://matplotlib.sourceforge.net/matplotlib.matlab.html A read through this page will give you a reasonably complete overview. Of course, you can also access these from the python shell >>> help(plot) or >>> help(text) or >>> help(set) Note the above is just for the matlab interface, which is what most people use. You can also embed matplotlib in GTK or WX applications. Generating pdf from the html pydoc output is reasonably easy, by the way, with a tool like htmldoc. A PDF User's Guide is a good idea. It's officially on the lost of things to do. JDH |
From: Nils W. <nw...@me...> - 2003-11-27 14:54:26
|
Hi all, I am wondering, if there is a tutorial (pdf-format) illustrating all features of matplotlib. Nils |
From: John H. <jdh...@ac...> - 2003-11-27 14:43:24
|
This is the alpha release of version 0.40. Lots of changes since 0.32, including some API changes which will require minor changes for application writers but no changes in the matlab interface. Please test this over the next couple of weeks so any bugs and changes can be included in the real release Here are the release notes What's new WX python backend Jeremy O'Donoghue has done an amazing job implementing the backend for wxpython, with all the features such as interactive navigation that are supported in the GTK backend. matplotlib should not be available with a GUI anywhere wxpython, Numeric and python work, including linux and friends, win32, and Mac OS X. See http://matplotlib.sourceforge.net/matplotlib.backends.backend_wx.html for a summary of known issues. Pseudo color plots The pcolor command generates pseudo color plots. See http://matplotlib.sourceforge.net/screenshots.html#pcolor_demo and http://matplotlib.sourceforge.net/screenshots.html#mri_with_eeg for screenshots and example code New time-series plotting functions * psd - plots the power spectral density of a time series * csd - plots the cross spectral density of two time series * cohere - plots the coherence See the examples dir in the src distro: psd_demo.py and csd_demo.py Substantially improved layout The transform architecture was refactored, allowing much more precise layout. Lines, patches, text, etc... can now be placed and scaled in arbitrary units, relative axes units, or physical size. Applicaiton programmers who want to create lines, patches and text directly using the API should read the transform module docs for more info. See the text help for an example of how to specify text locations in axes coords (0,0 is lower left and 1,1 is upper right) Expanded legend capabilities The legend class is improved, with a more sophisticated layout engine and the ability to accept lines and rectangle patches as an optional first argument to specify which lines/patches make up the legend. There are also additional legend placement locations, like 'upper center'. See http://matplotlib.sourceforge.net/screenshots.html#legend_demo Expanded errorbar capabilities Gary Ruben contributed some code to support x and y errorbars, either symmetrix or asymettric, in one enhanced function 'errorbar'. See the errorbar_demo.py for examples of all the wild and wonderful errorbar styles. Bar charts can now also display errorbars; see http://matplotlib.sourceforge.net/screenshots.html#barchart_demo Figure size and DPI controllable from matlab interface The figure command now takes optional args figsize and dpi to set the figure size and DPI in the matlab interface. This change involved some changes in the way default sizes and resolutions were handled among the various backends, with the effect that figures generated by existing scripts may appear different, eg, in the relative size of text to the figure elements. The advantage is that the current implementation does a better job of computing true sizes with increased fidelity between backends. Apologies for any inconveniences! API changes There have been some minor changes to the API for those using matplotlib embedded in GTK applications. * If you instantiate an Axes of Subplot intace, the first arg to __init__ must be the figure that contains it. * If you instantiate any artists, eg, Line2D, Rectangle, or AxisTextGTk, you must initialize them with their dpi, bbox, and transforms. See the help for the transforms modules and the examples logo.py and mri_with_eeg.py, where the objects are explicity created using the new API. * The only change to the matlab interface is in the signature of the errorbar func, which breaks matlab compatibility for the enhanced ability to do x and y errorbars. * See matplotlib.axes.py for a complete list of API changes |
From: John H. <jdh...@ac...> - 2003-11-25 14:59:20
|
>>>>> "Flavio" == Flavio C Coelho <fcc...@fi...> writes: Flavio> Hi, I accidentally deleted a message from Jeremy in which Flavio> he had code snippets that worked with the WX backend in Flavio> its current CVS incarnation. Have you read http://matplotlib.sourceforge.net/backends.html? There is nothing special about invoking the wx backend. The two ways of invoking a given backend are described on that page. If it's not clear after reading, please let me know so I can update the documentation (or provide suggestions for what can be clearer). Thanks! JDH |
From: John W. <jd...@go...> - 2003-11-24 15:57:16
|
Thanks for the help. Indeed I would like the toolbar eventually. Please let me know when it is fixed. jgw > P.S. In the example I've commented out the toolbar as I made > a mistake when I checked in __init__.py in the backends > directory, and the toolbar doesn't work right now. It will > be fixed tomorrow, if this matters. |
From: Jeremy O'D. <je...@o-...> - 2003-11-21 23:33:30
|
John, > John Wohlbier writes: > I ended up downloading the latest CVS using the command > cvs -z3 -d:pserver:anonymous@cv...:/cvsroot/matplotlib co > matplotlib > > and doing python setup.py install > > Now when I run my application (which worked with version 0.32) I get > this error on startup [snip] > ImportError: cannot import name FigureManagerBase You're not doing anything wrong - there have been some recent changes to the API which have moved FigureManagerBase. The example I posted just now does things a different way (and does work with latest CVS, honest!) > By the way, when I run the python setup.py install command will > the script properly overwrite the existing version of the matplotlib > library, or should I go in and delete the old library first? It updates things very nicely - no need to delete anything. Regards Jeremy |
From: John H. <jdh...@ac...> - 2003-11-21 23:31:46
|
>>>>> "John" == John Wohlbier <jd...@go...> writes: John> Am I doing something wrong? I guess I'll go back to version John> 0.32 for a while. No, it appears your CVS mirror is behind. This happens all the time. Here is a snapshot http://nitace.bsd.uchicago.edu:8080/files/share/matplotlib-0.40g.tar.gz John> By the way, when I run the python setup.py install command John> will the script properly overwrite the existing version of John> the matplotlib library, or should I go in and delete the old John> library first? The installer will overwrite files but will not delete files that are no longer used. There is no harm in deleting the old library and it might do some good. John> Thanks! No problem ... JDH |
From: John W. <jd...@go...> - 2003-11-21 23:18:57
|
I ended up downloading the latest CVS using the command cvs -z3 -d:pserver:ano...@cv...:/cvsroot/matplotlib co matplotlib and doing python setup.py install Now when I run my application (which worked with version 0.32) I get this error on startup Traceback (most recent call last): File "./mptwt.py", line 3, in ? from mp_win import * File "./mp_win.py", line 10, in ? from matplotlib.matlab import * File "/usr/lib/python2.2/site-packages/matplotlib/matlab.py", line 121, in ? from axes import Subplot, Axes File "/usr/lib/python2.2/site-packages/matplotlib/axes.py", line 118, in ? import backends File "/usr/lib/python2.2/site-packages/matplotlib/backends/__init__.py", line 21, in ? from backend_wx import AxisText, Figure, FigureManager, Gcf, \ File "/usr/lib/python2.2/site-packages/matplotlib/backends/backend_wx.py", line 164, in ? from matplotlib._matlab_helpers import FigureManagerBase, GcfBase ImportError: cannot import name FigureManagerBase Am I doing something wrong? I guess I'll go back to version 0.32 for a while. By the way, when I run the python setup.py install command will the script properly overwrite the existing version of the matplotlib library, or should I go in and delete the old library first? Thanks! jgw >>>>>> "John" == John Wohlbier <jd...@go...> writes: > > John> Hi, I am building a wxPython app, and would like to try > John> incorporating matplotlib, even though the wx backend is > John> reportedly in its development state. Could someone please > John> give a snippet of code using the wx backend? Also, do I need > John> pygtk even though I intend on using wxPython? > > The matplotlib code you write is more or less backend independent > (same for gtk, wx, ps, etc..). You do not need pygtk. You just need > wxpython and Numeric - which are both included in the enthought > edition of python for win32, by the way; http://enthought.com/python. > > If you just want to make some figure windows to explore the plotting > commands, you have 2 choices > > import matplotlib > matplotlib.use('WX') > from matplotlib.matlab import * > plot([1,2,3]) > show() > > or > # myscript.py > from matplotlib.matlab import * > plot([1,2,3]) > show() > > > python myscript.py -dWX > > That is, you choose the wx backend either by doing 'use' or -dWX. See > http://matplotlib.sourceforge.net/backends.html for more info. > > See the examples dir of the src distro for examples of how to make plots > more sophisticated than [1,2,3]. > > But I gather from your post that you want to see an example of > embedding the plot in an application. Jeremy, the wx backend > implemented, can probably help you more here. In the mean time, you > might want to look at the FigureManagerWX class in the file > matplotlib/backends/backend_wx.py to see how to embed a plot in a wx > frame. > > I recommend you use the latest CVS, which has a number of improvements > over the 0.32 release. If you don't have CVS access, let me know and > I'll send you a snapshot (are you on windows). > > John Hunter |
From: John H. <jdh...@ac...> - 2003-11-21 23:17:15
|
>>>>> "John" == John Wohlbier <jd...@go...> writes: John> Thanks, that worked for being able to generate the [1,2,3] John> plot from within my application. Eventually I will want to John> embed into a wxFrame, but for now I think this should John> suffice. I know Jeremy is planning on writing some example code to show how to embed wx in an application with or without the navigation toolbar, and possibly provide some utility classes to make it really easy. If you have bug reports or suggestions for improvement regarding the wx backend, the best place to send them is the matplotlib-dev mailing list - http://sourceforge.net/mailarchive/forum.php?forum_id=36187. There is a list of known bugs in header of the backend_wx.py code. John> I'm actually on linux, and am using 0.32 for now. I will get John> the latest CVS when I am up and running. When do you expect John> to release the next version? We're shooting for early December. JDH |
From: Jeremy O'D. <je...@o-...> - 2003-11-21 23:12:12
|
John Wohlbier writes: > Hi, > > I am building a wxPython app, and would like to try > incorporating matplotlib, even though the wx backend > is reportedly in its development state. > Could someone please give a snippet of code using > the wx backend? Also, do I need pygtk even though I > intend on using wxPython? Hi John, I'll answer your second question first: wxPython uses the 'native' widget set of whichever platform you are using, so if your platform is Windows or Mac you won't need gtk at all. If your platform is Linux or other Unix/BSD variant, I believe that wxPython depends on gtk, but not pyGtk (gtk has been used as the 'native' Unix widget set...) The answer to your first question is... it depends on what you are trying to do. I have modified the 'embedding_in_gtk.py' example to work under wxPython - it hasn't yet made it into CVS (it will shortly :-) It's about as simple as things get. If you don't want a navigation toolbar, simply leave out the calls to the toolbar. I've put the Figure (and toolbar) into a Sizer, as it's the easiest way to manage things. Regards Jeremy P.S. In the example I've commented out the toolbar as I made a mistake when I checked in __init__.py in the backends directory, and the toolbar doesn't work right now. It will be fixed tomorrow, if this matters. ========================================================== import matplotlib matplotlib.use('WX') from matplotlib.backends import Figure from matplotlib.axes import Subplot import Numeric as numpy from wxPython.wx import * class PlotFigure(wxFrame): def __init__(self): wxFrame.__init__(self, None, -1, "Test embedded wxFigure") self.fig = Figure(self, -1, (5,4), 72) #self.toolbar = Toolbar(self.fig) sizer = wxBoxSizer(wxVERTICAL) sizer.Add(self.fig, 0, wxTOP) #sizer.Add(self.toolbar, 1, wxGROW) self.SetSizer(sizer) self.Fit() def plot_data(self): a = Subplot(self.fig, 111) t = numpy.arange(0.0,3.0,0.01) s = numpy.sin(2*numpy.pi*t) a.plot(t,s) self.fig.add_axis(a) self.fig.draw() if __name__ == '__main__': app = wxPySimpleApp() frame = PlotFigure() frame.plot_data() frame.Show(true) app.MainLoop() In a larger program, it is probably simplest to create a class derived from wxPanel to encapsulate the plotting functionality. The skeleton would be something like: class PlottingPanel(wxPanel): def __init__(self, parent, id=-1) wxPanel.__init__(self, parent, id) self.fig = Figure(self, figsize=..., dpi=...) # Add a toolbar if you want... # Put the Figure into a sizer (toolbar as well, if needed) sizer = wxBoxSizer(...) sizer.Add(self.fig, ...) self.SetSizer(sizer) self.Fit() self.n_plot = 1 def add_subplot(x_list, y_list): assert len(x_list) == len(y_list), "Data sets must be same length" a = Subplot(self.fig, n*111) a.plot(x_list, y_list) self.fig.add_axis(a) For what it's worth, backend_wx is quite usable for basic plotting. There are a few oddities in the operation of the toolbar, which I haven't quite sorted out, and there is not yet the ability to save a plot as a graphic. I develop on wxPython for Win32 for a data analysis project which is the reason I started on backend_wx, but regression test everything on a Debian box (hence gtk) at home. You will need to use either a working snapshot (I believe John posted one a few days back), or keep a careful eye on the CVS. John is making some very worthwhile improvements in basic functionality, but I track these a day or so later in backend_wx (this makes my job much simpler as I basically just copy what John has done and 'translate' it to wx!) As of writing, the example above works with CVS. In a day or two it will appear as part of the matplotlib examples (probably with more comments!). For now it should get you going. |
From: John W. <jd...@go...> - 2003-11-21 22:55:47
|
Thanks, that worked for being able to generate the [1,2,3] plot from within my application. Eventually I will want to embed into a wxFrame, but for now I think this should suffice. I'm actually on linux, and am using 0.32 for now. I will get the latest CVS when I am up and running. When do you expect to release the next version? Thanks again, jgw >>>>>> "John" == John Wohlbier <jd...@go...> writes: > > John> Hi, I am building a wxPython app, and would like to try > John> incorporating matplotlib, even though the wx backend is > John> reportedly in its development state. Could someone please > John> give a snippet of code using the wx backend? Also, do I need > John> pygtk even though I intend on using wxPython? > > The matplotlib code you write is more or less backend independent > (same for gtk, wx, ps, etc..). You do not need pygtk. You just need > wxpython and Numeric - which are both included in the enthought > edition of python for win32, by the way; http://enthought.com/python. > > If you just want to make some figure windows to explore the plotting > commands, you have 2 choices > > import matplotlib > matplotlib.use('WX') > from matplotlib.matlab import * > plot([1,2,3]) > show() > > or > # myscript.py > from matplotlib.matlab import * > plot([1,2,3]) > show() > > > python myscript.py -dWX > > That is, you choose the wx backend either by doing 'use' or -dWX. See > http://matplotlib.sourceforge.net/backends.html for more info. > > See the examples dir of the src distro for examples of how to make plots > more sophisticated than [1,2,3]. > > But I gather from your post that you want to see an example of > embedding the plot in an application. Jeremy, the wx backend > implemented, can probably help you more here. In the mean time, you > might want to look at the FigureManagerWX class in the file > matplotlib/backends/backend_wx.py to see how to embed a plot in a wx > frame. > > I recommend you use the latest CVS, which has a number of improvements > over the 0.32 release. If you don't have CVS access, let me know and > I'll send you a snapshot (are you on windows). > > John Hunter |
From: John H. <jdh...@ac...> - 2003-11-21 22:32:24
|
>>>>> "John" == John Wohlbier <jd...@go...> writes: John> Hi, I am building a wxPython app, and would like to try John> incorporating matplotlib, even though the wx backend is John> reportedly in its development state. Could someone please John> give a snippet of code using the wx backend? Also, do I need John> pygtk even though I intend on using wxPython? The matplotlib code you write is more or less backend independent (same for gtk, wx, ps, etc..). You do not need pygtk. You just need wxpython and Numeric - which are both included in the enthought edition of python for win32, by the way; http://enthought.com/python. If you just want to make some figure windows to explore the plotting commands, you have 2 choices import matplotlib matplotlib.use('WX') from matplotlib.matlab import * plot([1,2,3]) show() or # myscript.py from matplotlib.matlab import * plot([1,2,3]) show() > python myscript.py -dWX That is, you choose the wx backend either by doing 'use' or -dWX. See http://matplotlib.sourceforge.net/backends.html for more info. See the examples dir of the src distro for examples of how to make plots more sophisticated than [1,2,3]. But I gather from your post that you want to see an example of embedding the plot in an application. Jeremy, the wx backend implemented, can probably help you more here. In the mean time, you might want to look at the FigureManagerWX class in the file matplotlib/backends/backend_wx.py to see how to embed a plot in a wx frame. I recommend you use the latest CVS, which has a number of improvements over the 0.32 release. If you don't have CVS access, let me know and I'll send you a snapshot (are you on windows). John Hunter |
From: John W. <jd...@go...> - 2003-11-21 20:44:42
|
Hi, I am building a wxPython app, and would like to try incorporating matplotlib, even though the wx backend is reportedly in its development state. Could someone please give a snippet of code using the wx backend? Also, do I need pygtk even though I intend on using wxPython? Thanks! jgw |
From: John H. <jdh...@ac...> - 2003-11-20 22:43:05
|
>>>>> "Sandeep" == Sandeep Shetty <cab...@ya...> writes: John> According to what you wrote, you did everything correct. John> Many people run matplotlib under a variety of Microsoft John> environments, so you shouldn't have much trouble. My guess John> is that the PATH is not properly set. Which dir did you John> install the GTK runtime in? By default, I believe, it goes John> into a dir with spaces in the name, which are difficult to John> handle correctly in the PATH. For this reason, I always John> install the GTK runtime into C:\GTK and then add C:\GTK\lib John> and c:\GTK\bin to my PATH. Sandeep> Hi John, Thanks for getting back to me. I tried to start Sandeep> from scratch and got the same results. My path variable Sandeep> is set as follows: Path=c:\oracle\ora81\bin\;c:\Program Sandeep> Files\Oracle\jre\1.1.7\bin\;C:\WINNT\system32;C:\WINNT;C:\WINNT Sandeep> \System32\Wbem;d:\matlab6p5\bin\win32;d:\matlab\bin\win32;D:\Tcl\bin;c:\Program Sandeep> Files\ssh communicat ions security\ssh Secure Sandeep> Shell;c:\oracle\ora81\bin\;c:\Program Sandeep> Files\Oracle\jre\1.1.7\bin\;C:\WINNT\ Sandeep> system32;C:\WINNT;C:\WINNT\System32\Wbem;d:\matlab6p5\bin\win32;d:\matlab\bin\win32;d:\Modeltech_5.5 Sandeep> e\win32;d:\bin;d:\gnuwin32\b18\H-i386-cygwin32\bin;d:\PkZip;d:\Python23;C:\GTK\lib;C:\GTK\bin I still wonder if there is a problem because of all those paths that have spaces (eg, all those with "Program File" in them before the GTK path entry.) For example, when I open a 'command' shell in windows XP and do C:> set to display my PATH, all the Program File entries are listed as C:\progra~1\somepath with no spaces. When you do the same from the command shell, are any spaces listed? Please try the following. Open a command shell with Start menu->Run->command ENTER C:> set PATH=C:\GTK\bin;C:\GTK\lib C:> d:\python23\python >>> import pygtk >>> pygtk.require('2.0') >>> import gobject and tell me what happens. I that works, the odds are that you have a PATH problem. If not, its something else. If it does work, try >>> from matplotlib.matlab import * >>> plot([1,2,3,]) >>> show() Sandeep> Are are either of these the correct file for gobject? Or Sandeep> is gobject found some place else? This looks good; I do have one additional gobject file, however, C:\Python23\Include\pygtk-2.0\pygobject Sandeep> If you think it is better I wait for the next rev of Sandeep> matlibplot, I can wait. Nonetheless, I would love to use Sandeep> your library as soon as possible. The problem is that this is most likely not intrinsic to matplotlib, but to your GTK settings. So you'll likely have the same problems in the next release. There are many win32 users so don't despair, this should be a relatively easy fix. Perhaps someone on the users list has some input? JDH |
From: John H. <jdh...@ac...> - 2003-11-19 14:21:46
|
>>>>> "Flavio" == Flavio C Coelho <fcc...@fi...> writes: Flavio> Hi john, I've been away for a couple of weeks, and I just Flavio> did a "cvs update" to test the new features especially the Flavio> WX backend which I was very anxious to test. I guess this is why they call CVS bleeding edge, eh? Yes, bug crept in last night and is fixed in CVS as of early this morning. Note to self: don't do commits over an xterm past 11PM. However, the wx backend has not yet caught up with the latest changes since Jeremy is out of town until Friday. I expect he'll do an update then. I've uploaded a Nov 15th snapshot which has a working wx backend to a temporary web site. There are still a number of known bugs (eg, figure placement and size) that Jeremy is systematically squashing but it won't be long (target date early December). Have fun testing. Please let us know if you find any bugs not in the known bugs section of backends/backend_wx.py. http://nitace.bsd.uchicago.edu:8080/files/share/matplotlib-0.40d.tar.gz JDH |
From: John H. <jdh...@ac...> - 2003-11-19 14:02:09
|
>>>>> "Charles" == Charles R Twardy <cha...@in...> writes: Charles> I might even suggest replacing the "pan" and "zoom" Charles> buttons by just using left-click and right-click for the Charles> drag. That way I can change tasks without mousing Charles> around. Zoom-rectangle could even be middle-click. This is the way VTK does it and it is great. All three mouse buttons are used for pan, zoom and rotate. The only problem is for application developers using matplotlib, who will probably want to reserve some of the mouse buttons over figures for context menus or measurement tools, etc... I have done both in my applications. Its possible to do both via different toolbars, but there are only so many hours in the day. I'll let it simmer. JDH |
From: Charles R. T. <cha...@in...> - 2003-11-19 08:55:07
|
Hi John, New navbar sounds good, esp. replacing arrows with hand. Default to hand mode (maybe even revert after completing an operation with other modes). I'm not so happy with all the modifier keys. I'd have one modifier key, Shift, that constrains the motion, and everything be drag-based: * In pan mode, Shift drag restricts motion to whichever the principle mouse direction is. I can keep it within 45 degrees myself, and this allows me to easily change x, then y. * In zoom mode, Shift drag zooms along principle mouse direction. Otherwise zooms as radial distance of drag. Mousewheel zoom zooms both axes. * Zoom rectangle: Shift-drag maintains axis ratio in drawing the rectangle. I might even suggest replacing the "pan" and "zoom" buttons by just using left-click and right-click for the drag. That way I can change tasks without mousing around. Zoom-rectangle could even be middle-click. -Charles -- Charles R. Twardy www.csse.monash.edu.au/~ctwardy Monash University sarbayes.org Computer Sci. & Software Eng. +61(3) 9905 5823 (w) 5146 (fax) |
From: John H. <jdh...@ac...> - 2003-11-17 15:50:14
|
>>>>> "Nelson" == Nelson Minar <ne...@mo...> writes: Nelson> John Hunter <jdh...@ac...> writes: >> There are a lot of good plotting libraries out there. I'll >> pitch mine. http://matplotlib.sourceforge.net Nelson> Thanks for posting this! I've been using gdchart for a Nelson> long time because it's simple and the graphs aren't too Nelson> bad. But it's very limited, in particular your X axis has Nelson> to be equally spaced. Hi Nelson, thanks for the email and the detailed comments. It would be great to have you join the mailing list - other users would benefit from your comments - http://lists.sourceforge.net/mailman/listinfo/matplotlib-users Nelson> I spent about an hour with matplotlib. It's clear you put Nelson> a lot of work into this, and I think this could be a Nelson> really great library. Some thoughts for you from a casual Nelson> user: Nelson> The installation prerequisites are a bit daunting but on a Nelson> Debian system it's not too bad. Debian has many of the Nelson> packages you need: apt-get install python2.3-numeric Nelson> python2.3-numarray python2.3-numeric-ext apt-get install Nelson> fonttools libgd2-dev python2.3-gtk2 python2.3-numeric-ext Nelson> is easy to forget: you need that for FFT and MLab. I'll update the web page with this information for debian users. Debian is great; unfortunately, I don't get much opportunity to use it so I haven't gone through the process of installing matplotlib on debian. There was some interest on the mailing list earlier about getting matplotlib packaged for debian, and an RFP was made, but I don't there has been any any progress on this front. Charles, Nathan, any comments here? Nelson> The only things I had to install from sources were Nelson> TTFQuery and gdmodule, and both of those were easy. Nelson> I'd like to use this module as a simple thing to create Nelson> PNGs of graphs from data to put on web pages. The GD Nelson> driver is most of what I need, and the idea that I could Nelson> also do postscript output is great. But the packaging of Nelson> matplotlib is a bit funky. The most confusing thing was Nelson> the way you read sys.argv - that's probably not good for a Nelson> resuable library. I agree to a certain extent. But I don't modify the args and they will be without effect if you use the incantation, as you did import matplotlib matplotlib.use('GD') Mainly, I did it because I wanted an easy way to switch between backends without switching scripts. There are other ways to do this however. Unless the presence of the sys.argv is causing a problem, I am hesitant to remove it to maintain backwards compatibility. If you can think of a problem, please let me know. Nelson> I was also mystified as to how to set the plotsize using Nelson> the matlab module. I gave up and ended up doing something Nelson> else, but it was so much work I felt like I probably did Nelson> something wrong: Nelson> import matplotlib Nelson> matplotlib.use('GD') Nelson> from matplotlib.backends import Figure Nelson> from matplotlib.axes import Subplot Nelson> f = Figure(figsize=(3, 2), dpi=100) Nelson> a = Subplot(111) Nelson> a.plot([1,2,3,4], [1,4,9,16]) Nelson> f.add_axis(a) Nelson> f.print_figure("nelson2.png", 100) You're right on the money here. The ability to control the dpi, figsize and other attributes from the matlab interface is limited. I think I'll add kwargs to the fig command to enable this, and plan to go to a backend specific config file for the next release -- a .matplotlibrc file containing a dictionary that provided default font, figsize, dpi, etc, for each backend. But beyond this, it is important to be able to control these attributes at the script level using the matlab interface. I'm glad you figured out the workaround by using the API. JDH |
From: Gary R. <ga...@em...> - 2003-11-17 14:28:35
|
Sounds awesomely powerful - not since the development of John Harrison's clocks will navigation have taken such a great step forward :-) ----- Original Message ----- From: John Hunter <jdh...@ac...> Date: Sun, 16 Nov 2003 07:50:53 -0600 To: "Gary Ruben" <ga...@em...> Subject: Re: [Matplotlib-users] Navigation toolbar redraw button > >>>>> "Gary" == Gary Ruben <ga...@em...> writes: > > Gary> I think it's important to always have an easy way of zooming > Gary> out to show the full plot, so if you implement your saved > Gary> view idea and don't want to add a 'fit to full data' button, > Gary> I think having a 'fit to full data' checkpoint automatically > Gary> added is important. It might be even be worth looking into > Gary> cacheing the full view to speed its rendering. That way, you > Gary> could quickly navigate by zooming to full and then using a > Gary> rectangle zoom to your area of interest. > > Combining my original thoughts with yours and Charles, then. How > about the following? Allow the user to select the old style toolbar > from a config file, but the new toolbar would > > 1) lose all the left, right, up down buttons, in favor of a single > 'hand' icon that allows you to move the view limits by 'grabbing > them in the axes and moving them around. With x or y key pressed > the pan motion will be contained to the respective axis. The > mouse button which activates this in the axes should be easily > configurable so as to not class with application developers. > > 2) have a zoom in and zoom out button that work on both axis > symmetrically unless the 'x' or 'y' modifier keys are pressed in > which case work only on that axis. Allow similar functionality > with the mouse in the axes, eg wheel mouse, as Charles suggested > or mouse-3 as vtk interactor windows use. Then you could pan and > zoom in an axes without ever removing your mouse from the axes > lim. > > 3) have a zoom rectangle tool that allows you to zoom to a selected > rectangle, constrained to maintain axis ratio if CTRL is pressed > > 4) have a zoom to data button that changes viewlim to incorporate > entire dataset > > 5) use the 'views' navigation with forward / mark / and back buttons > that allows you to navigate between views > > 6) lose the redraw button, obsolete > > 7) have a savefig button which allows you to set the dpi, filename > and backend, so you can output with ps, gd, or gtk backend > > 8) close window unchanged. > > Further comments? > > JDH -- __________________________________________________________ Sign-up for your own personalized E-mail at Mail.com http://www.mail.com/?sr=signup Search Smarter - get the new eXact Search Bar for free! http://www.exactsearchbar.com/ |
From: John H. <jdh...@ac...> - 2003-11-16 15:56:58
|
>>>>> "Jay" == Jay Eichelberger <mje...@ea...> writes: Jay> Greetings, Thank you for the reply.!! Hi Jay, I suggest you join the matplotlib mailing list http://lists.sourceforge.net/mailman/listinfo/matplotlib-users Jay> I started using Cygwin at work, where it is used to port Java Jay> code between Linux, solaris, and windows. (( Jay> http://www.onesaf.org/ )) I installed it at home on my laptop Jay> - which runs windows - wasn't able to find all of the Linux Jay> device drivers. Cyqwin has GCC compilers - which I used to Jay> write C program that called a public server that generated Jay> html and jpgs with charts. Jay> Alas, the service is no more. Jay> May I ask your opinion? Is there a simple way to do this? Jay> :-) After 5 hours of surfing and digging, it seems like I Jay> would need: - data for the charts - an api for a Jay> chart-generator - an output method - portable output If I understand you correctly, yes this is simple. First, though, I am not clear if you want to generate the charts and look at them immediately, or if you want to run the script in batch mode and produce figures which are not displayed, but are perhaps embedded in some html for use with a web server. Both are possible but the way you go about it is a little different. I'm going to assume the former for now. Jay> Graph paper and a compass are starting to look good.. :-) Jay> Seriously, if I install Python, MatLab and GTK on windows, Jay> what would the chart output be?? I think you are referring to matplotlib, not matlab. matplotlib is an open source python library for producing graphics with a matlab-like syntax. matlab is a proprietary application developed by The Mathworks. If you install python, Numeric, pygtk, GTK and matplotlib following the instructions on the matplotlib web site, it should be fairly easy to do statistical charting with or without cygwin. That seems like a lot of packages but it is easy since they all have friendly windows installers. If you have a fast internet connection and can do a 60MB download, I recommend the enthought addition of python http://enthought.com/python/ since it comes Numeric, scipy, wxpython and a lot of extra goodies you'll find useful down the road. To install GTK and pygtk, it is important that you follow the instructions at http://matplotlib.sourceforge.net/installing.html; basically you have to set a PATH. Your prototype matplotlib script would be from matplotlib.matlab import * x, y = ... your data here ... plot(x,y) show() This would open a GTK window which you can use to view, interact with, and save your output. I recommend saving figures as PNG, which is a nice, portable image format, if you want to put them on a web page or send them to a colleague as an attachment, or PS for publication quality. Let me know in a little more detail what it is you are trying to achieve and I (or someone else on the matplotlib-users mailing list) can probably offer some more help. JDH |
From: John H. <jdh...@ac...> - 2003-11-16 13:56:23
|
>>>>> "Gary" == Gary Ruben <ga...@em...> writes: Gary> I think it's important to always have an easy way of zooming Gary> out to show the full plot, so if you implement your saved Gary> view idea and don't want to add a 'fit to full data' button, Gary> I think having a 'fit to full data' checkpoint automatically Gary> added is important. It might be even be worth looking into Gary> cacheing the full view to speed its rendering. That way, you Gary> could quickly navigate by zooming to full and then using a Gary> rectangle zoom to your area of interest. Combining my original thoughts with yours and Charles, then. How about the following? Allow the user to select the old style toolbar from a config file, but the new toolbar would 1) lose all the left, right, up down buttons, in favor of a single 'hand' icon that allows you to move the view limits by 'grabbing them in the axes and moving them around. With x or y key pressed the pan motion will be contained to the respective axis. The mouse button which activates this in the axes should be easily configurable so as to not class with application developers. 2) have a zoom in and zoom out button that work on both axis symmetrically unless the 'x' or 'y' modifier keys are pressed in which case work only on that axis. Allow similar functionality with the mouse in the axes, eg wheel mouse, as Charles suggested or mouse-3 as vtk interactor windows use. Then you could pan and zoom in an axes without ever removing your mouse from the axes lim. 3) have a zoom rectangle tool that allows you to zoom to a selected rectangle, constrained to maintain axis ratio if CTRL is pressed 4) have a zoom to data button that changes viewlim to incorporate entire dataset 5) use the 'views' navigation with forward / mark / and back buttons that allows you to navigate between views 6) lose the redraw button, obsolete 7) have a savefig button which allows you to set the dpi, filename and backend, so you can output with ps, gd, or gtk backend 8) close window unchanged. Further comments? JDH |
From: John H. <jdh...@ac...> - 2003-11-16 13:45:49
|
>>>>> "Gary" == Gary Ruben <ga...@em...> writes: Gary> Have you thought about whether it's possible to use the Gary> interactive gtk (or wx) viewer to zoom to a region of Gary> interest then change the backend to PS to save the current Gary> view as a PS or EPS? I have no idea whether this is Gary> possible. I have thought about this. It would be nice to work in gtk/wx and then be able to 'save as' postscript. This shouldn't be too hard. It's basically a matter of initializing the postscript figure with the axes contained in the gtk figure. Thinking aloud in pseudo-py-code .. in the gtk print function ... if ext matches postscript: psfig = FigurePS(args) psfig._axes = self._axes psfig._text = self._text psfig._figurePatch = self._figurePatch psfig.print_figure(filename) return I'll look into it. I think it is eminently doable. Barring any major roadblocks I'll post a patch today. This reminds me: it would be nice to be able to set the dpi from the print_figure dialog in the GUI as you can with the savefig commmand. BTW Gary, in CVS I have reworked the transform architecture and now you can create lines (and patches) in data units (as before), relative axes units (0-1) or physical units (points, inches, centimeters). So I will make the necessary changes to the errorbar code to get the cap lines specified in the appropriate units. My feeling is that they should be in points (physical size) but the alternative is in fractional axes size. The main difference between the 2 is that in the latter case they change if you are, for example, subplot(221) versus subplot(111), or if you resize the figure window, and in the former case they do not. Thoughts? JDH |
From: Gary R. <ga...@em...> - 2003-11-16 02:53:04
|
Have you thought about whether it's possible to use the interactive gtk (or wx) viewer to zoom to a region of interest then change the backend to PS to save the current view as a PS or EPS? I have no idea whether this is possible. Gary -- __________________________________________________________ Sign-up for your own personalized E-mail at Mail.com http://www.mail.com/?sr=signup Search Smarter - get the new eXact Search Bar for free! http://www.exactsearchbar.com/ |