From: John H. <jdh...@ac...> - 2004-12-14 18:36:01
|
These notes, with links, can be read at http://matplotlib.sf.net/whats_new.html. - matlab namespace renamed pylab - see http://matplotlib.sf.net/matplotlib_to_pylab.py for details on conversion. ipython pylab users should grab version 0.6.6. You can import the matlab interface (now known as pylab interface) with from pylab import blah # OK from matplotlib.pylab import blah # OK from matplotlib.matlab import blah # Deprecated - contouring with the contour function!! Thanks to Nadia Dencheva. See examples/contour_demo.py - matlab compatible set and get introspection to determine settable properties and their values. See examples/set_and_get.py. Sample usage >>> lines = plot([1,2,3]) >>> set(lines) alpha: float antialiased or aa: [True | False] ...snip lots more... >>> get(lines) alpha = 1.0 antialiased or aa = True ...snip lots more... - Added many new matlab compatible colormaps - autumn bone cool copper flag gray hot hsv jet pink prism spring summer winter - Thanks Perry! - zorder to artists to control drawing order of lines, patches and text in axes. See examples/zorder_demo.py - mathtext in cairo backend. Also, printing now works to file object. Thanks Steve Chaplin. - printing in WX - Matthew Newville contributed a print button and preview for the wx backends. He also, who graciously volunteered to be the new wx backend maintainer. - matlab interface functions connect and disconnect replace mpl_connect and mpl_disconnect for event handling - Pass hold=True|False to any plotting command to override the current hold setting. The original hold setting will be restored at the end of the plot function - all text instances now have a bbox property which is a dict of Rectangle properties. If set, the text instance will display in a rectanglular bounding box. Example usage title('hi mom', bbox={'facecolor':'r', 'alpha':0.5}) - legend properties now exposed as kwargs. See help(legend) - ishold to inspect the hold state - new plotting functions spy, spy2 for matrix sparsity visualization - pylab interface functions rgrids and thetagrids for customizing the grid locations and labels for polar plots - see examples/polar_demo.py. - add ion, ioff and isinteractive to pylab interface for control of interactive mode. See updated discussion at http://matplotlib.sf.net/interactive.html Bugs fixed - - Fixed colorbar bug with scatter - JDH - SVG clipping problem - Thanks Norm Peterson - numerous small legend bugs fixed - zoom to rect works with reversed axis limits - thanks Gregory - fontsizing problem fixes, ps plots correctly sized, landscape support for ps output - smaller, leaner, meaner PS output - Thanks Jochen - make the Gtk backends build without an X-server connection - Thanks Jochen Downloads at http://matplotlib.sf.net JDH |
From: Eli G. <eg...@se...> - 2004-12-15 18:46:14
|
Hello, Is there an easy way to set the initial position of a Figure? I'm using Windows XP and new figures seem to pop up in the typical Windows fashion where subsequent figures appear about 20 pixels down and 20 pixels to the right of previous figures. How can I tell each figure where to pop up on screen? Thanks, Eli |
From: John H. <jdh...@ac...> - 2004-12-15 22:52:32
|
>>>>> "Eli" == Eli Glaser <eg...@se...> writes: Eli> Hello, Is there an easy way to set the initial position of a Eli> Figure? I'm using Windows XP and new figures seem to pop up Eli> in the typical Windows fashion where subsequent figures Eli> appear about 20 pixels down and 20 pixels to the right of Eli> previous figures. How can I tell each figure where to pop up Eli> on screen? matplotlib doesn't provide explicit support for this, but it is possible. What backend are you using. The matplotlib Figure is embedded in a FigureCanvas which is typically a GUI widget embedded in a GUI Window. In the pylab interface, the canvas is managed by a FigureManager, which has a window attribute on most of the backends. Eg for the GTK backend, for example, you could do from pylab import * import gtk figure(1) plot([1,2,3]) manager = get_current_fig_manager() # see gtk.Window class docs at # http://www.pygtk.org/pygtk2reference/class-gtkwindow.html manager.window.set_position(gtk.WIN_POS_CENTER) figure(2) plot([1,2,3]) manager = get_current_fig_manager() # see gtk.Window class docs at # http://www.pygtk.org/pygtk2reference/class-gtkwindow.html manager.window.set_position(gtk.WIN_POS_NONE) show() For the WX* backend, manager.window is a wxFrame - http://www.lpthe.jussieu.fr/~zeitlin/wxWindows/docs/wxwin_wxframe.html#wxframe For the TkAgg backend, manager.window is a Tkinter.Tk instance - http://starship.python.net/crew/fredrik/tkclass/ClassToplevel.html Off the top of my head I don't know the right incantation for each backend, but hopefully the classdocs I referenced above will help. Perhaps Todd or Matthew can chime in with more Tk and WX information. While this arrangement may be suboptimal, we are resisting the urge to become a GUI library. The temptations to abstract GUI functions for use in matplotlib are many, and we are trying to keep this to a manageable core (some event handling, some basic window management, etc.). It's been on my list of things to do to investigate anygui, however - http://anygui.sourceforge.net - which would appear to solve our problems but might require a substantial refactoring of the matplotlib backends. If you want full GUI control, you can embed matplotlib in your own GUI application, following one of the many embedding_in_*.py examples in the examples subdirectory of the matplotlib src distribution. If you come up with example code for your backend, please post it to the list. JDH |
From: Eli G. <eg...@se...> - 2004-12-15 23:38:41
|
Thanks, John! That's exactly what I was looking for I'm using the WX backend and I was able to do: figure(1) plot([1,2,3]) manager = get_current_fig_manager() manager.window.SetPosition((100,100)) #or manager.window.Centre() Eli > Eg for the GTK backend, for example, you could do > > from pylab import * > > import gtk > > figure(1) > plot([1,2,3]) > manager = get_current_fig_manager() > > # see gtk.Window class docs at > # http://www.pygtk.org/pygtk2reference/class-gtkwindow.html > manager.window.set_position(gtk.WIN_POS_CENTER) > > figure(2) > plot([1,2,3]) > manager = get_current_fig_manager() > > # see gtk.Window class docs at > # http://www.pygtk.org/pygtk2reference/class-gtkwindow.html > manager.window.set_position(gtk.WIN_POS_NONE) > > show() > > For the WX* backend, manager.window is a wxFrame - > http://www.lpthe.jussieu.fr/~zeitlin/wxWindows/docs/wxwin_wxframe.html#wxframe > > For the TkAgg backend, manager.window is a Tkinter.Tk instance - > http://starship.python.net/crew/fredrik/tkclass/ClassToplevel.html > > Off the top of my head I don't know the right incantation for each > backend, but hopefully the classdocs I referenced above will help. > Perhaps Todd or Matthew can chime in with more Tk and WX information. > > While this arrangement may be suboptimal, we are resisting the urge to > become a GUI library. The temptations to abstract GUI functions for > use in matplotlib are many, and we are trying to keep this to a > manageable core (some event handling, some basic window management, > etc.). It's been on my list of things to do to investigate anygui, > however - http://anygui.sourceforge.net - which would appear to solve > our problems but might require a substantial refactoring of the > matplotlib backends. > > If you want full GUI control, you can embed matplotlib in your own GUI > application, following one of the many embedding_in_*.py examples in > the examples subdirectory of the matplotlib src distribution. > > If you come up with example code for your backend, please post it to > the list. > > JDH > > > ------------------------------------------------------- > SF email is sponsored by - The IT Product Guide > Read honest & candid reviews on hundreds of IT Products from real users. > Discover which products truly live up to the hype. Start reading now. > http://productguide.itmanagersjournal.com/ > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users |
From: Todd M. <jm...@st...> - 2004-12-16 00:02:37
|
On Wed, 2004-12-15 at 16:49 -0600, John Hunter wrote: > >>>>> "Eli" == Eli Glaser <eg...@se...> writes: > > Eli> Hello, Is there an easy way to set the initial position of a > Eli> Figure? I'm using Windows XP and new figures seem to pop up > Eli> in the typical Windows fashion where subsequent figures > Eli> appear about 20 pixels down and 20 pixels to the right of > Eli> previous figures. How can I tell each figure where to pop up > Eli> on screen? > > matplotlib doesn't provide explicit support for this, but it is > possible. What backend are you using. The matplotlib Figure is > embedded in a FigureCanvas which is typically a GUI widget embedded in > a GUI Window. In the pylab interface, the canvas is managed by a > FigureManager, which has a window attribute on most of the backends. > > Eg for the GTK backend, for example, you could do > > from pylab import * > > import gtk > > figure(1) > plot([1,2,3]) > manager = get_current_fig_manager() > > # see gtk.Window class docs at > # http://www.pygtk.org/pygtk2reference/class-gtkwindow.html > manager.window.set_position(gtk.WIN_POS_CENTER) > > figure(2) > plot([1,2,3]) > manager = get_current_fig_manager() > > # see gtk.Window class docs at > # http://www.pygtk.org/pygtk2reference/class-gtkwindow.html > manager.window.set_position(gtk.WIN_POS_NONE) > > show() > > For the WX* backend, manager.window is a wxFrame - > http://www.lpthe.jussieu.fr/~zeitlin/wxWindows/docs/wxwin_wxframe.html#wxframe > > For the TkAgg backend, manager.window is a Tkinter.Tk instance - > http://starship.python.net/crew/fredrik/tkclass/ClassToplevel.html > > Off the top of my head I don't know the right incantation for each > backend, but hopefully the classdocs I referenced above will help. > Perhaps Todd or Matthew can chime in with more Tk and WX information. In TkAgg it works like this: get_current_fig_manager().window.wm_geometry("+200+300") To set the window position to X=200, Y=300. Todd |
From: Gary <pa...@in...> - 2004-12-16 03:05:49
|
As is becoming usual, my attempt to upgrade has run into a problem. WinXP, deleted previous ...\matplotlib before installing. None of the examples (from the new zip file) seem to run. They generally seem to start with from pylab import * but this fails, even from the command line. Bug, feature, or pilot error? :) -gary ---------------------------------------------------------- C:\Python23\Lib\site-packages\matplotlib\examples>python Python 2.3.4 (#53, May 25 2004, 21:17:02) [MSC v.1200 32 bit (Intel)] on win32 Type "help", "copyright", "credits" or "license" for more information. >>> from pylab import * Traceback (most recent call last): File "<stdin>", line 1, in ? File "C:\Python23\Lib\site-packages\pylab.py", line 1, in ? from matplotlib.pylab import * File "C:\Python23\Lib\site-packages\matplotlib\pylab.py", line 184, in ? from axes import Axes, PolarAxes File "C:\Python23\Lib\site-packages\matplotlib\axes.py", line 6, in ? from numerix import MLab, absolute, arange, array, asarray, ones, transpose, \ ImportError: cannot import name min |
From: Alan G I. <ai...@am...> - 2004-12-16 03:21:10
|
On Wed, 15 Dec 2004, Gary apparently wrote: > from pylab import * Either first import everything from matplotlib or do instead from matplotlib.pylab import * hth, Alan Isaac |
From: John H. <jdh...@ac...> - 2004-12-16 15:55:07
|
>>>>> "Gary" == Gary <pa...@in...> writes: from numerix import MLab, absolute, arange, array, ImportError: cannot import name This looks like a bug. Right before the release I cleaned up axes.py because the numerix min should not be mixed with the builtin min. Hence I did # do not import numerix max! we are using python max. from numerix import MLab, absolute, arange, array, asarray, ones, transpose, \ log, log10, Float, ravel, zeros, Int32, Float64, ceil, min, indices, \ shape, which from numerix import max as nxmax from numerix import min as nxmin I should have also remove min from the numerix import (oversight), which I already caught and fixed in CVS thanks to pychecker. So removing "min" from the numerix import in axes.py should fix your problem, but\ I'm surprised that you are unable to import min from the numerix module. So before you fix it could you run a test script with > python myscript.py --verbose-helpful and report the output, particularly the numerix version information. Perhaps Todd or I can then offer some insight into why the MLab.min function is not in the numerix namespace. I can do >>> from matplotlib.numerix import min with both Numeric and numarrary (latest release or CVS of both). My guess is that you cannot, and I'd like to know why. You appear cursed in your ability to get a working matplotlib win32 upgrade! Maybe next time.... JDH |
From: Gary <pa...@in...> - 2004-12-17 14:07:30
|
John Hunter wrote: >[...] > >So removing "min" from the numerix import in axes.py should fix your >problem, but\ I'm surprised that you are unable to import min from the >numerix module. So before you fix it could you run a test script with > > > python myscript.py --verbose-helpful > >and report the output, particularly the numerix version information. > > --------------------------------------------------------------------- C:\Python23\Lib\site-packages\matplotlib\examples>python simple_plot.py --verbose-helpful matplotlib data path C:\Python23\share\matplotlib loaded rc file C:\Python23\share\matplotlib\.matplotlibrc matplotlib version 0.65 verbose.level helpful interactive is False platform is win32 numerix Numeric 23.0 Traceback (most recent call last): File "simple_plot.py", line 3, in ? from pylab import * File "C:\Python23\Lib\site-packages\pylab.py", line 1, in ? from matplotlib.pylab import * File "C:\Python23\Lib\site-packages\matplotlib\pylab.py", line 184, in ? from axes import Axes, PolarAxes File "C:\Python23\Lib\site-packages\matplotlib\axes.py", line 6, in ? from numerix import MLab, absolute, arange, array, asarray, ones, transpose, \ ImportError: cannot import name min ----------------------------------------------------------------------------------- >Perhaps Todd or I can then offer some insight into why the MLab.min >function is not in the numerix namespace. I can do > > >>> from matplotlib.numerix import min > > > correct: --------------------------------------------------------------------- C:\Python23\Lib\site-packages\matplotlib\examples>python Python 2.3.4 (#53, May 25 2004, 21:17:02) [MSC v.1200 32 bit (Intel)] on win32 Type "help", "copyright", "credits" or "license" for more information. >>> from matplotlib.numerix import min Traceback (most recent call last): File "<stdin>", line 1, in ? ImportError: cannot import name min ---------------------------------------------------------------- >with both Numeric and numarrary (latest release or CVS of both). My >guess is that you cannot, and I'd like to know why. > >You appear cursed in your ability to get a working matplotlib win32 >upgrade! Maybe next time.... > > Off topic comment: I have a number or little annoyances with various packages. Enough that I decided that I would try migrating to Linux. My Thinkpad has only a modest HD, so I didn't want to partition it. I could buy a bigger drive. But my Thinkpad can boot from an external USB device, so I started wondering if I could set up a Linux entirely on the external drive, and not touch my internal drive. If it worked, I'd have a portable Linux (portable, at least, to any machine that can boot from USB). I searched the web, and found mixed reviews concening the viability of this idea. So I bought a USB enclosure ($10 on eBay) and a 20 GB drive ($33 on eBay, but read on) and went to town. After about three months of back-burner late-night tinkering, I got it working! A week later, my external HD crashed. I'm waiting for some extra time to appear before trying again. If anyone is interested, I can provide some pointers. (once I'm finished, I'll post my experinces on a web site somewhere) Two initial comments: 1.) be very careful about buying a "Travelstar" HD on eBay. Apparantly manufacturing problems resulted in a large number of faulty units getting into circulation. 2.) I was *not* successful using Mandrake or Mepis. I was successful using Fedora FC2. |
From: John H. <jdh...@ac...> - 2004-12-17 14:52:36
|
>>>>> "Gary" == Gary <pa...@in...> writes: Gary> --------------------------------------------------------------------- Gary> C:\Python23\Lib\site-packages\matplotlib\examples>python Gary> Python 2.3.4 (#53, May 25 2004, 21:17:02) [MSC v.1200 32 bit Gary> (Intel)] on win32 Type "help", "copyright", "credits" or Gary> "license" for more information. >>>> from matplotlib.numerix import min Gary> Traceback (most recent call last): File "<stdin>", line 1, Gary> in ? ImportError: cannot import name min Gary> ---------------------------------------------------------------- It looks like your Numeric install is screwed up. Remove site-packages Numeric to be on the safe side and grab the latest release for your python version at http://sourceforge.net/projects/numpy reinstall and see if that fixes your problem. Let me know... JDH |
From: Gary <pa...@in...> - 2004-12-18 14:54:53
|
John Hunter wrote: >>>>>>"Gary" == Gary <pa...@in...> writes: >>>>>> >>>>>> > > Gary> --------------------------------------------------------------------- > Gary> C:\Python23\Lib\site-packages\matplotlib\examples>python > Gary> Python 2.3.4 (#53, May 25 2004, 21:17:02) [MSC v.1200 32 bit > Gary> (Intel)] on win32 Type "help", "copyright", "credits" or > Gary> "license" for more information. > >>>> from matplotlib.numerix import min > Gary> Traceback (most recent call last): File "<stdin>", line 1, > Gary> in ? ImportError: cannot import name min > Gary> ---------------------------------------------------------------- > >It looks like your Numeric install is screwed up. Remove >site-packages Numeric to be on the safe side and grab the latest >release for your python version at > > http://sourceforge.net/projects/numpy > >reinstall and see if that fixes your problem. Let me know... > >JDH > > > I'm sorry to report no change. I uninstalled Numeric and matplotlib, and reinstalled both, and nothing has changed. Am I the only one suffereing from this? Isn't this impossible? I tried this several times. I uninstalled using the Control Panel Add and Remove feature, and then trashed the remaining directory. I searched the registry for lurking remnants (there was a mention of an uninstaller and .matplotlibrc. that's all. I left those entries alone.) I checked .matplotlibrc... nothing obviously unusual, just numerix:Numeric. A week ago I did a virus scan on the whole system, and ran spybot. (I'll probably run those again tonight for good measure.) The version of Numeric that I installed is 23.6, the latest. I'm using python 2.3.4 I changed axes.py to remove 'min' from the 'from numerix import ...' line. Now it chokes on the very next line, from numerix import max as nxmax ... and happy holidays. -gary |
From: John H. <jdh...@ac...> - 2004-12-18 16:25:35
|
>>>>> "Gary" == Gary <pa...@in...> writes: Gary> I changed axes.py to remove 'min' from the 'from numerix Gary> import ...' line. Gary> Now it chokes on the very next line, from numerix import max Gary> as nxmax Let's be systematic. From the python shell, what happens when you do >>> import Numeric, MLab >>> Numeric.__version__ >>> from MLab import min, max >>> import matplotlib >>> matplotlib.__version__ >>> from matplotlib.numerix import min, max This will help narrow down whether it's a matplotlib or Numeric problem. Check the reported version numbers to make sure the numeric upgrade went as expected. Do you have only one python installed on your system? Gary> Am I the only one suffereing from this? Isn't this impossible? My win32 setup appears to be working fine. It's clearly not impossible <wink>. Can we get some positive confirmation from other win32 users that 0.65 is working for them? JDH |
From: Alan G I. <ai...@am...> - 2004-12-18 16:53:05
|
On Sat, 18 Dec 2004, John Hunter apparently wrote: > Can we get some positive confirmation from other > win32 users that 0.65 is working for them? No problems yet on Win2000 Pro or Win XP. (I have only run a few scripts since my upgrade, but they all worked.) Alan Isaac |
From: Gary <pa...@in...> - 2004-12-19 17:56:44
|
John Hunter wrote: >>>>>>"Gary" == Gary <pa...@in...> writes: >>>>>> >>>>>> > Gary> I changed axes.py to remove 'min' from the 'from numerix > Gary> import ...' line. > > Gary> Now it chokes on the very next line, from numerix import max > Gary> as nxmax > >Let's be systematic. From the python shell, what happens when you do > > >>> import Numeric, MLab > >>> Numeric.__version__ > >>> from MLab import min, max > >>> import matplotlib > >>> matplotlib.__version__ > >>> from matplotlib.numerix import min, max > > C:\Documents and Settings\Gary>python Python 2.3.4 (#53, May 25 2004, 21:17:02) [MSC v.1200 32 bit (Intel)] on win32 Type "help", "copyright", "credits" or "license" for more information. >>> import Numeric, MLab >>> Numeric.__version__ '23.6' >>> from MLab import min, max >>> import matplotlib >>> matplotlib.__version__ '0.65' >>> from matplotlib.numerix import min, max Traceback (most recent call last): File "<stdin>", line 1, in ? ImportError: cannot import name min >This will help narrow down whether it's a matplotlib or Numeric >problem. Check the reported version numbers to make sure the numeric >upgrade went as expected. > >Do you have only one python installed on your system? > > No. IBM (this is a thinkpad) has installed a python in c:\ibmtools\python22 I'm guessing they use it for some kind of maintenance. Up to now, it's existance has been almost entirely benign, except for a warning I get when starting ipython. There's an issue somewhere with the case of the file fcntl.pyc (vs FCNTL.pyc) and/or the pythoncaseok environment variable. I swatted it down a couple of times, but it keeps coming back. I realize that things aren't exactly as they should be, but nothing has broken ... yet. IBM has set pythonpath for me: C:\Documents and Settings\Gary>echo %pythonpath% C:\IBMTOOLS\utils\support;C:\IBMTOOLS\utils\logger However, if I un-set %pythonpath% I still can't import pylab. (No change in behavior) %path% references c:\ibmtools\python22, but only after all the listings for c:\python23. AFAICT no other environment variable references the IBM python. > Gary> Am I the only one suffereing from this? Isn't this impossible? > >My win32 setup appears to be working fine. It's clearly not >impossible <wink>. Can we get some positive confirmation from other >win32 users that 0.65 is working for them? > >JDH > > > Thanks for your help on this. Since I appear to be an isolated case, shall we take this off-group? |