From: John H. <jdh...@ac...> - 2004-03-03 23:29:54
|
What's new in matplotlib 0.51 Tkinter backend Todd Miller has written a Tkinter backend. This is a significant step forward, because now matplotlib works out of the box with any python + numeric. The Tkinter backend works interactively from any python shell - see the interactive documentation. Also, because TkAgg uses the agg backend for rendering, it has all of the features of agg, including fast antialiased rendering, freetype2, alpha blending, mathtext, and so on. See http://matplotlib.sf.net/backends.html#TkAgg. To use the TkAgg backend, you must launch your scripts in interactive mode > python -i myscript.py -dTkAgg otherwise they'll just pop up and disappear. freetype2 support added for agg backend With freetype2, agg now renders fonts nicely even at very small raster sizes. math text matplotlib now ships with the BaKoMa TeX Computer Modern fonts, and displays math text using TeX expressions. See screenshot http://matplotlib.sf.net/screenshots.html#mathtext_demo and the mathtext documentation http://matplotlib.sf.net/matplotlib.mathtext.html for usage information. Currently available on GTK, Agg, TkAgg and GTKAgg. If you build matplotlib yourself, you need to edit setup.py and set BUILD_FT2FONT configuration file A configuration file is placed in your install path (distutils.sysconfig.PREFIX + 'share/matplotlib'). This determines many of the default figure properties: the default backend, line properties, text properties, colors, and more. See http://matplotlib.sf.net/.matplotlibrc for an example configuration file and details. Place this in your home dir (linux and friends), or edit in the install path (windows). numarray support Todd Miller has provided a numerix module http://matplotlib.sf.net/matplotlib.numerix.html which allows you to choose between Numeric of numarray. You can set Numeric or numarray in your matplotlibrc file, with an environment variable, or from the prompt. See the numerix module for more information and numarray issues http://matplotlib.sf.net/NUMARRAY_ISSUES for a summary of known issues in using numarray. data clipping off by default Data clipping, as opposed to viewport clipping, is turned off by default. You can change the default behavior in .matplotlibrc or set it to be true when needed as in examples/stock_demo.py kwargs in plot commands The plot commands now take kwargs that are can be used to set line properties (any property that has a set_* method). You can use this to set a line label (for auto legends), linewidth, anitialising, marker face color, etc. Here is an example: plot([1,2,3], [1,2,3], 'go-', label='line 1', linewidth=2) plot([1,2,3], [1,4,9], 'rs', label='line 2') axis([0, 4, 0, 10]) legend() Bugfixes and minor improvements * GTK : fixed a subplot selection GUI bug specific to python2.2 * GTK : fixed a text layout bug * ALL : Fixed a multiple column subplot layout bug * PS : Fixed an afm parser - thanks Dominique * Agg : Agg now respects antialiased=False Download: http://sourceforge.net/project/showfiles.php?group_id=80706&package_id=82474&release_id=221304 |
From: matthew a. <ma...@ca...> - 2004-03-04 06:11:37
|
Well that was one juicy update! I was just trying to figure out how to speed up the completer in interactive.py (which adds a noticable lag to the prompt if len(locals()) gets to 3000 like it does for me) when I noticed this new release. TkAgg allows me to use the default python in interactive mode, which allows me to use rlcompleter, *and* have matplotlib plots pop up without losing the prompt. Which is all lovely. A couple of issues I noticed with TkAgg: * fontTools installed one of its files (FontTools.pth I think) without read permission for normal users, which cause import fontTools to fail mysteriously * fontTools didn't find my TTF fonts because the extensions were TTF instead of ttf * if I savefig('file.eps') from the TkAgg backend, the EPS file is sized to something much bigger than A4 (but it still works fine from the GTK backend) * after playing around, I found that text.fontname : sans in .matplotlibrc is the only way to get reasonably nice sans serif both in TkAgg and in eps files. Otherwise I get complaints from one or the other (e.g. if I specify Arial or Helvetica). Cheers and thanks, Matthew. |
From: matthew a. <ma...@ca...> - 2004-03-05 06:01:12
|
On Thu, 4 Mar 2004, matthew arnison wrote: > * if I savefig('file.eps') from the TkAgg backend, the EPS file is sized > to something much bigger than A4 (but it still works fine from the GTK > backend) I've just found I've had similar problems saving EPS figures from the GTK backend of matplotlib 0.51 too. Plus TkAgg doesn't like it if you close a plot using the window close box (not the X in the toolbar): [I have TkAgg as my default backend in ~/.matplotlibrc and interactive set to True] $ python Python 2.2.2 (#1, Feb 24 2003, 19:13:11) [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-4)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> from matplotlib.matlab import * >>> x = arange(0.0, 3.14, 0.01) >>> plot(x, sin(x)) [<matplotlib.lines.Line2D instance at 0x84143b4>] ... click on window close button (not toolbar close button) ... >>> plot(x, sin(x)) Traceback (most recent call last): File "<stdin>", line 1, in ? File "/usr/lib/python2.2/site-packages/matplotlib/matlab.py", line 788, in plot draw_if_interactive() File "/usr/lib/python2.2/site-packages/matplotlib/backends/backend_tkagg.py", line 46, in draw_if_interactive figManager.show() File "/usr/lib/python2.2/site-packages/matplotlib/backends/backend_tkagg.py", line 121, in show self.window.deiconify() File "/usr/lib/python2.2/lib-tk/Tkinter.py", line 1343, in wm_deiconify return self.tk.call('wm', 'deiconify', self._w) TclError: can't invoke "wm" command: application has been destroyed m. |