From: Todd M. <jm...@st...> - 2004-04-28 19:21:01
|
On Wed, 2004-04-28 at 10:14, José Alexandre Nalon wrote: > 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 -- Todd Miller <jm...@st...> |