From: Christopher B. <Chr...@no...> - 2010-01-19 17:26:58
|
> Wayne Watson wrote: >> I've used MPL a bit, and am wondering if there's a facility for sending >> graphic images to a printer, or putting them in some format like png? you've already gotten an answer to the png part, but as for printing directly: I suspect you could make a pdf and send that to the printer with a system call, though it would be different on each system, and I don't know how any of those work any more (you used to be able to do "print filename" on Windows (or DOS, anyway!), and, of course, on *nix systems, "lpr filename" used to work. Another option is to use a GUI back end, but never bring up a window. You can use wxPython this way -- you need to create a wx.App(), and you may need to create a wx.Frame to put the MPL plot in (or you may not), but you don't have to Show() it. You an then call the wx printing code to print. I imagine it's similar for QT and GTK and TK. Note that for wx at least, you do need access to a Windowing system, even if you aren't displaying anything. HTH, -Chris -- Christopher Barker, Ph.D. Oceanographer Emergency Response Division NOAA/NOS/OR&R (206) 526-6959 voice 7600 Sand Point Way NE (206) 526-6329 fax Seattle, WA 98115 (206) 526-6317 main reception Chr...@no... |