ANN: matplotlib-0.50 - python plots

J

John Hunter

matplotlib is a python 2D plotting library which produces publication
quality figures using in a variety of hardcopy formats (PNG, JPG,
TIFF, PS) and interactive GUI environments (WX, GTK) across platforms.
matplotlib can be used in python scripts, interactively from the
python shell (ala matlab or mathematica), in web application servers
generating dynamic charts, or embedded in GTK or WX applications.

http://matplotlib.sourceforge.net

What's new in matplotlib 0.50

Antigrain backend: Agg

Adding to the growing list of image backends is Antigrain --
http://antigrain.com. This is a backend written mostly in extension
code and is the fastest of all the image backends. Agg supports
freetype fonts, antialiased drawing, alpha blending, and much
more. The windows installer contains everything you need except
Numeric to use the agg backend out of the box; for other platforms
see http://matplotlib.sourceforge.net/backends.html#Agg

Paint/libart backend

David Moore wrote a backend for pypaint, a libart wrapper. libart is
a high quality, cross platform image renderer that supports
antialiased lines, freetype fonts, and other capabilities to soon be
exploited. Thanks David! See
http://matplotlib.sourceforge.net/backends.html#Paint for more
information and install instructions

The Matplotlib FAQ

Matplotlib now has a FAQ -- http://matplotlib.sourceforge.net/faq.html

Alpha channel attribute

All the figure elements now have an alpha attribute to allow
blending and translucency. Not all backends are currenly capable of
supporting alpha - currently only Agg, but Paint should be able to
support this soon - see the scatter screenshot for an example of
alpha at work
http://matplotlib.sourceforge.net/screenshots.html#scatter_demo2

Table class added

John Gill has developed a very nice Table class and table function
that plays well with bar charts and stacked bar charts. See example
code and screenshot table_demo at
http://matplotlib.sourceforge.net/screenshots.html#table_demo

New plot commands cla and clf

Clear the current axes or figure. Useful in interactive plotting
from a python shell

GD module on win32

With much weeping and gnashing of teeth and help from half the
people on this globe, built a gdmodule win32 installer. Special
thanks to Stefan Kuzminski for putting up with my endless windows
confusions. See the win32 quickstart at installing the GD backend -
http://matplotlib.sourceforge.net/backends.html#GDWIN32

GD supports clipping and antialiased line drawing

See instructions about upgrading gd and gdmodule at Installing the
GD backend. The line object has a new 'antialiased' property, that
if True, the backend will render the line antialiased if
supported. Note antialiased drawing under GD is slow, so be sure to
turn the property off set(lines, 'antialiased', False) if you
experience performance problems. If you need performance and
antialiasing, use the agg backend.

Wild and wonderful bar charts

You can provide an optional argument bottom to the bar command to
determine where the bottom of each bar is, default 0 for all. This
enables stacked bar plots and candelstick plots --
examples/bar_stacked.py. Thanks to David Moore and John Gill for
suggestions and code.

Figure backend refactored

The figure functionality was split into a backend independent
component Figure and a backend dependent component
FigureCanvasBase. This completes the transition to a totally
abstract figure interface and improves the ability the switch
backends and a figure to multiple backends. See API_CHANGES for
information on migrating applications to the new API at
http://matplotlib.sourceforge.net/API_CHANGES

Tons of bug fixes and optimizations detailed at
http://matplotlib.sourceforge.net/whats_new.html
 
L

Lou Pecora

I checked the web site and maybe I missed it, but I didn't see a list of
platforms supported although Red Hat and Windows were mentioned in
backend requirements. In particular, is the Macintosh (OS X) supported?

Thanks.
 
J

John Hunter

Lou> I checked the web site and maybe I missed it, but I didn't
Lou> see a list of platforms supported although Red Hat and
Lou> Windows were mentioned in backend requirements. In
Lou> particular, is the Macintosh (OS X) supported?

Most of the matplotlib backends work fine on OS X. Basically, you
just need to make sure you have the prerequisites for a given backend
installed as described on
http://matplotlib.sourceforge.net/backends.html. Eg if you want to
use the wx backend, you'll need wxpython, if you want to use the gtk
backend, you'll need to install GTK and pygtk (available with fink),
and so on.

I did have to make a change to setupext.py for the antigrain backend.
If you want to compile antigrain on OS X, set the BUILD_AGG and
BUILD_FONTTOOLS flags in setup.py and replace setupext.py with the
file linked here

http://nitace.bsd.uchicago.edu:8080/files/share/setupext.py

Let me know how this works,
JDH
 
J

John Hunter

n4482> I'm running python 2.3.3 on Windows XP.

n4482> Any thoughts?

Have you ever installed any other gtk products before (earlier
versions of pygtk, gtk, glade, gimp, or other gtk related dlls).
Older installs put some stuff in windows system dirs that causes
errors like you are getting. Read this FAQ entry

"I cannot import gtk / gdk / gobject" at
http://matplotlib.sourceforge.net/faq.html which points to this
discussion on pygtk mailing list from someone who had a similar
problem
http://www.mail-archive.com/[email protected]/msg07324.html

Let me know how it goes.

JDH
 
N

n4482

Hi,

I'm trying to play with matplotlib, but am having installation trouble.

I installed GTK from GTK-Runtime-Environment-2.2.4.1.exe into
c:\gtk as suggested in the installation notes and added
c:\gtk\bin and c:\gtk\lib to the path.

I installed pygtk from pygtk-2.0.0.win32-py2.3.exe and matplotlib from
matplotlib-0.50.win32-py2.3.exe.

If I try to executeI get a dialog box titled: python.exe - Entry Point Not Found and
The procedure entry point libiconv_set_reloaction_prefix
could not be located in the dynamic link library iconv.dll.

The following traceback is issued:

Traceback (most recent call last):
File "<stdin>", line 1, in ?
File "C:\Python23\Lib\site-packages\matplotlib\matlab.py", line 126, in ?
from backends import new_figure_manager, error_msg, \
File "C:\Python23\Lib\site-packages\matplotlib\backends\__init__.py", line 16,
in ?
from backend_gtk import \
File "C:\Python23\Lib\site-packages\matplotlib\backends\backend_gtk.py", line
13, in ?
import gobject
ImportError: DLL load failed: The specified procedure could not be found.
I'm running python 2.3.3 on Windows XP.

Any thoughts?

Dave
 
D

Dave

Hi John,

Thanks for the nudge in the right direction.

I looked for instances of iconv.dll and found two in lib and bin dirs
of a tcl install. I'm not using tcl (just downloaded it to look at a
long time ago) so I removed that, and the uninstaller crashed, and
I had to clean up junk by hand, and it seemed a good idea to reboot XP,
and . . . voila, I can run the scripts in the tutorial now!

Thanks,

Dave
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,968
Messages
2,570,153
Members
46,699
Latest member
AnneRosen

Latest Threads

Top