another pango font error

I was wondering why matplotlib strives to support so many

    > backends...

Accretion. In the beginning there was GTK, but being a LaTeX user, I
needed a postscript output. Also, there was a lot of interest in a
pure image backend that could make JPG/PNG/etc w/o having a window
popup. gdmodule is a python module wrapping the very nice gd library
so I wrote the gd backend to provide pure image generation (could have
just as easily done PIL at this point). Around the same time, David
Moore, also needing a pure image backend (gd hadn't been ported to
win32 yet), stealthily developed paint, a libart backend. Meanwhile,
Jeremy needed wx at work, and developed the wx backend.

At this time the proliferation of backends was beginning to become a
maintenance hassle, and Perry Greenfield had a bright idea: another
backend! But not just any old backend, the mother of all backends,
that could be used not only for pure image generation but used to
render directly into the GUI canvases. GTK and WX use native GUI
drawing code to render the figure, so we not only need to support not
only all the widget-set related stuff, but all the drawing stuff as
well.

The new idea is to focus development on one high quality image backend
and use this in as many areas as possible. We looked hard at libart
and gd, but both had bugs that could not be fixed. Having worked with
the developers of chaco, Perry suggested antigrain which is a very
high quality 2D image library that I've just begun to scratch the
surface of. So Agg was born and the GUI wrappers GTKAgg, TkAgg and
WXAgg quickly followed suit. These 3 are the GUI backends of choice
for performance, feature set, and quality.

I still support the other backends because people still use them but
spend less energy porting all the new features to them. If someone
says "I need alpha blending on WX", I usually say "Can you use
WXAgg?", and so on. postscript is still very actively maintained
because it is in a different category and widely used for publication
and TeX.

    > I wrote a gui app in matlab that takes the fourier
    > transform of a semi-infinite crystal. The point is to
    > simulate X-ray diffraction (I work at the Cornell
    > Synchrotron). The program is pretty good, from a science
    > standpoint. I am considering publishing the work, but I
    > wanted to make it open source. What's the point of doing
    > work funded by the NSF if the public can't access it? So I
    > am investigating rewriting the code using pygtk. I wanted
    > something free and cross platform, and I need the
    > vectorized matrix operations.

    > Aside from that specific project, I am just trying to get
    > the interactive feel of matlab. I need to take some time
    > to look carefully through all the documentation here, it
    > seems all of my questions have had answers published on
    > the web.

Sounds very similar to my situation. I develop a pretty complex
application for EEG and medical image data analysis. I originally
wrote it in matlab but became dissatisfied with the ability of matlab
to easily manipulate complex data structures, work with databases,
fill out CGI forms, and the like. You can do all of this in matlab
using the matlab JVM stuff (and I did), but it's a pain and it's slow.
I started over in python and decided on pygtk. I couldn't find a 2D
plotting library I was satisfied with so wrote matplotlib around
pygtk. If you need any additional encouragement, the quality of the
application and the ease of extending it are dramatically better now.

I develop on linux and most of the users are on win32, and have been
very happy with GTK on win32. The only bug I've seen on OS X is that
progress bars don't seem to work. Now I see why you were looking at
interactive2.py -- you want to embed a python shell in your
application. I think pygtk + matplotlib + GTKAgg
+ a modified interactive2.py is a good combination for you. Some
features of interactive2.py are underdeveloped, such as cutting and
pasting code blocks from an editor into the interpreter.

You may also want to look into VTK if you need 3D plotting, which has
nice integration with pygtk. I use this a lot in my application. I
find it amazing that you can embed an OpenGL window into a GTK widget
set wrapped by pygtk running in a python interpreter on a Microsoft
Windows OS and still get hardware acceleration!

JDH

Greetings.

I'm new to matplotlib and to this list. I know it is a
good thing to wait a little before posting, but I need
some work done quickly, so I had to post a message as
soon as I could. I also couldn't find in the list
archives a solution to my problems, so I had to ask.
Bear with me, please.

I must say that I'm very impressed with the overall
quality of the figures generated with matplotlib, and
the possibility to add TeX expression as labels is a
fantastic feature that I have never even thought about
(but now I can't live without).

I had some problems though, which I report below. Some
of them I could solve (by hacking a little), others I
didn't.

* I use TK backend, but also tried wx. They didn't work
  well: in the TK backend, in interactive mode, the fi-
  gure take a lot of time to be rendered, and sometimes
  it does not. The same with wx. I looked into the
  code of 'show' method in backend_tkagg.py, and did
  some changes. The Tk.mainloop() was commented, I
  uncommented it. I also changed the interactive mode
  to False. By doing this, I lost the interactive
  environment, but at least the figure shows quickly
  when I use the 'show' command. I don't know if this
  has been an issue for everyone, or if it is a problem
  with compatibility with what I have installed here
  (it is Python 2.3.2, Windows ME, Tk 8.4, if I'm right),
  but if there is a better solution to it, I'd like to
  hear.

* Also in the backend_tkagg.py there was two lines with
  wrong identation. Line 181 (method show of
  FigureManagerTkAgg class and line 416 (method update
  of NavigationToolbar class) were not idented correctly.
  I tried identing them and everything seems to be working
  fine. I might have changed something that I shouldn't,
  though.

* Well, here is my real problem. I need to generate EPS
  files of my pictures for use with TeX (MiKTeX). I'm
  having a lot of trouble with it (this includes problems
  with the GS conversion tool, but that is beyond the
  scope of this list). Basically, using TkAgg or the
  savefig method, I can generate a PS file with the
  figure. But the problem is that the figure does not
  show well - it is bigger than the generated page, so a
  very significant part of the figure is cut out. Is
  there anyway to resize the picture or tell matplotlib
  to fit the picture within specified dimensions (like
  some and some centimeters or inches height and width)?
  Resizing the drawing window _did_ solve the problem,
  but then I can't generate the figures by scripting -
  I would have to manually resize everyone of them.

* The EPS problem I might solve with a little hack, and
  generate an EPS file directly from my scripts. If this
  turns out to work well, I will contribute the code, of
  course, if the developers would want it.

* Another very important thing to me is to generate the
  plot of discrete functions (like the Matlab 'mesh'
  command). Is there anyway to do that with matplotlib?
  If not, can I suggest it as a feature request? :slight_smile:

That's all for now. Thanks for the great software.

···

---
Jos� Alexandre Nalon
nalon@...166...

John writes:
I still support the other backends because people still use them but
spend less energy porting all the new features to them. If someone
says "I need alpha blending on WX", I usually say "Can you use
WXAgg?", and so on. postscript is still very actively maintained
because it is in a different category and widely used for publication
and TeX.

All things to all people...PS support is a big selling point.

Now I see why you were looking at
interactive2.py -- you want to embed a python shell in your
application.

No, not really. I was just reading through the documentation, found interactive2, and tried it out. I like the command recall better than Idle. It would be interesting to have a matplotlib user interface, akin to the one from Matlab. If for no other reason than to make converts like myself feel familiar. For example, I still dont know how to change the working directory from inside the shell, or how to access a list of attributes for an object.

You may also want to look into VTK if you need 3D plotting, which has
nice integration with pygtk. I use this a lot in my application. I
find it amazing that you can embed an OpenGL window into a GTK widget
set wrapped by pygtk running in a python interpreter on a Microsoft
Windows OS and still get hardware acceleration!

And a partridge in a pear tree.

(that IS impressive!)

Greetings.

I'm new to matplotlib and to this list. I know it is a
good thing to wait a little before posting, but I need
some work done quickly, so I had to post a message as
soon as I could. I also couldn't find in the list
archives a solution to my problems, so I had to ask.
Bear with me, please.

I must say that I'm very impressed with the overall
quality of the figures generated with matplotlib, and
the possibility to add TeX expression as labels is a
fantastic feature that I have never even thought about
(but now I can't live without).

I had some problems though, which I report below. Some
of them I could solve (by hacking a little), others I
didn't.

* I use TK backend, but also tried wx. They didn't work
  well: in the TK backend, in interactive mode, the fi-
  gure take a lot of time to be rendered, and sometimes
  it does not. The same with wx. I looked into the
  code of 'show' method in backend_tkagg.py, and did
  some changes. The Tk.mainloop() was commented, I
  uncommented it. I also changed the interactive mode
  to False. By doing this, I lost the interactive
  environment, but at least the figure shows quickly
  when I use the 'show' command. I don't know if this
  has been an issue for everyone, or if it is a problem
  with compatibility with what I have installed here
  (it is Python 2.3.2, Windows ME, Tk 8.4, if I'm right),
  but if there is a better solution to it, I'd like to
  hear.

I can't look at this today but I'll try to look tomorrow.

* Also in the backend_tkagg.py there was two lines with
  wrong identation. Line 181 (method show of
  FigureManagerTkAgg class and line 416 (method update
  of NavigationToolbar class) were not idented correctly.
  I tried identing them and everything seems to be working
  fine. I might have changed something that I shouldn't,
  though.

I got these. Thanks.

* Well, here is my real problem. I need to generate EPS
  files of my pictures for use with TeX (MiKTeX). I'm
  having a lot of trouble with it (this includes problems
  with the GS conversion tool, but that is beyond the
  scope of this list). Basically, using TkAgg or the
  savefig method, I can generate a PS file with the
  figure. But the problem is that the figure does not
  show well - it is bigger than the generated page, so a
  very significant part of the figure is cut out. Is
  there anyway to resize the picture or tell matplotlib
  to fit the picture within specified dimensions (like
  some and some centimeters or inches height and width)?
  Resizing the drawing window _did_ solve the problem,
  but then I can't generate the figures by scripting -
  I would have to manually resize everyone of them.

I'm not sure it's made clear anywhere, but you can generate EPS by using
the extension ".ep" or ".eps".

Regards,
Todd

···

On Wed, 2004-04-28 at 10:14, José Alexandre Nalon wrote:

--
Todd Miller <jmiller@...86...>

John Hunter wrote:

At this time the proliferation of backends was beginning to become a
maintenance hassle, and Perry Greenfield had a bright idea: another
backend! But not just any old backend, the mother of all backends,
that could be used not only for pure image generation but used to
render directly into the GUI canvases. GTK and WX use native GUI
drawing code to render the figure, so we not only need to support not
only all the widget-set related stuff, but all the drawing stuff as
well.

Well, it wasn't really my idea. Eric Jones adopted this approach
for Chaco and it seemed like a good way of adding lots of functionality
and removing gui plotting depenencies. So I basically passed the
idea along.

Perry