From: Chris B. <Chr...@no...> - 2005-04-28 04:18:34
|
Rich Drewes wrote: > That said, since my script never actually tried to do some display, it > would be spiffy if matplotlib postponed any X oriented stuff that accesses > the display until the user actually requests a show(). That way, if the > script just does a savefig(.ps) at the end as mine did, things would Just > Work. I'm just guessing here, but I bet the problem comes up when importing pylab, not matplotlib. The pylab interface was designed to be an easy to use interface for interactive use, ala Matlab. It therefor is expecting to display stuff. For scripts that generate figures for printing or web apps, or whatever, pylab is not really the best option. That being said, most of the effort towards usability has goine into the pylab module, so there is alot of stuff that is easier to do that way. I ahev a goal to create a nice pythonic, OO interface for use in scripting (and would be bad in interactive use either), but haven't really had a chance to work on it. Mostly what it would require is to write helpful handy mnethods that do the things that the pylab procedural interface already does. So far all I've done is make a few suggestions, some of which John has implimented. In the meantime, I use the matplotlib.use() function, and use pylab when I need to. -Chris -Chris |