From: <na...@te...> - 2004-04-28 14:18:58
|
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? :) That's all for now. Thanks for the great software. --- José Alexandre Nalon na...@te... |