From: Grant Edwards on
On 2009-09-15, John Nagle <nagle(a)animats.com> wrote:

> Tried PyChart. Set up for PNG file format. Got the error
> "Exception: Ghostscript not found." This thing just creates
> PostScript, then pumps it through GhostScript (anybody remember that?)

Remember it? It's an actively maintained program and I use it
every day.

--
Grant

From: Michel Claveau - MVP on
Hi!

Perso I use a wrapper to RMCHART.
There are two versions : DLL & COM. I prefer COM.
Warning : only on Windows's family.

@-salutations
--
Michel Claveau

From: Alan G Isaac on
> Alan G Isaac wrote:
>> There's John Zelle's graphics.py:
>> http://mcsp.wartburg.edu/zelle/python/
>> provides basic functionality.


On 9/16/2009 12:33 AM, John Nagle wrote:
> "The package is a wrapper around Tkinter". It runs Tkinter
> in a separate thread and sends commands to it.


Tkinter is part of the Python standard library:
http://docs.python.org/library/tk.html
Are you really ruling out its use for a "pure Python"
solution?

If you want a Python solution to not just create
the graphs but also to view them, it is hard to
see how you will do without this. What exactly
are you trying to accomplish?

Alan Isaac

PS I think ReportLab can generate PDF vector graphics
even in the absence of a C compiler (which it will
use if available).

From: rober on
On Sep 15, 6:28 pm, John Nagle <na...(a)animats.com> wrote:
> John Nagle wrote:
> > I'mlookingfor something that can draw simple bar and pie charts
> > inPython. I'm trying to find aPythonpackage, not a wrapper for
> > some C library, as this has to run on both Windows and Linux
> > and version clashes are a problem.
>
> > Here's the list from thePythonwiki at
> > "http://wiki.python.org/moin/NumericAndScientific/Plotting".
> > Almost all the options are really wrappers for some other
> > package in C/C++.
>
> > * Matplotlib -- wrapper for Antigrain, written in C/C++
> > * Veusz -- requires PyQt fromhttp://www.riverbankcomputing.co.uk/pyqt,
> > which is in C/C++
> > * Chaco -- requires binaries for Enthought Tool Suite
> > * ScientificPython - uses mix of C, C++, and FORTRAN.
> > * Gnuplotmodule-- wrapper for GNUPLOT
> > * plot_wrap - wrapper for GNU plotutils
> > * BLT - "tcltk.com" link goes to a domain squatter site.
> > * PyQT - wrapper for Qwt C++ library
> > * DISLIN - interface to C++ DISLIN system
> > * Mayavi - interface to Mayavai2, standalone program
> > * gdmodule GD -pythonwrapper for the GD library.
> > * Gist - wrapper for gist graphics library
> > * pgplot - Wrapper for pgplot.
> > * Py-OpenDX - wrapper for IBM Data Explorer
> > * VTK - wrapper for VTK in C++
> > * RPy - wrapper for R programming lnaguage
> > * PyX - wrapper for Tex.
> > * Biggles - wrapper for C++module
> > * Pychart - 100%Python (NOT!), but last updated 21-Dec-2005.
> > * PyNGL - uses PyNIO, which is in C
> > * pygooglechart -Pythoninterface to the GoogleChartLookinAPI, only
> > works in browser
>
> > So, forpurePython, Pychart is it. I'll have to try it and see if it
> > still works.
>
> http://home.gna.org/pychart/doc/introduction.html
>
> Tried PyChart. Set up for PNG file format. Got the error
> "Exception: Ghostscript not found." This thing just creates
> PostScript, then pumps it through GhostScript (anybody remember that?)
> to get other formats. And does the documentation say that? Only
> in the FAQ section. Grrr.
>
> There doesn't seem to be anypurePythonchartmoduleat all.
> Just wrappers.
>
> John Nagle

Hi John,
I had the same problem using Btl. Blt generate postscript file and I
needed several others formats, then I did something like this:

.....
cmd = [gspath,
'-sDEVICE=%s'%device,
'-sOutputFile=%s'%onormfile,
'-dNOPAUSE -q -dBATCH',
'%s'%inormfile,
]
gscmd = ' '.join(cmd)
try:
retcode = call(gscmd, shell=True)
if retcode > 0:
log.error("'ghostscript' return whit error code '%d'"%retcode)
except OSError, e:
log.error("Error trying execute 'ghostscript'")
....

remarks:
- gspath is the absolute path to the ghostscript executable
- device can be 'pdfwrite', 'jpeg', 'bmp256', 'png256'
- onormfile is the output filename normalized to the OS
- inormfile is the postscript filename normalized to the OS
- call is the function of subprocess module

warning: ghostscript do not accept spaces in the filenames, so be
carefull if you is working in win32, even enclosing between " ".

PS:
For those people that sugest use Blt. I use Blt a lot in linux and
win32 but it is not port (yet) to TK8.5 so, it do not works with
py2.6, and is really painfull to build in win32.
Beside that, in order to use Blt, you need an instance of Tk running,
ergo a XWindows running, an some times it is not the case for linux
servers. In that cases I am using Mathplotlib, but a pure python
solution will be GREAT!

my 0.005 cents.

roberto



From: Robin Becker on

> PS:
> For those people that sugest use Blt. I use Blt a lot in linux and
> win32 but it is not port (yet) to TK8.5 so, it do not works with
> py2.6, and is really painfull to build in win32.
> Beside that, in order to use Blt, you need an instance of Tk running,
> ergo a XWindows running, an some times it is not the case for linux
> servers. In that cases I am using Mathplotlib, but a pure python
> solution will be GREAT!
>
>
We've been having some problems with Blt in various 64 bit versions of ubuntu. I
don't use it directly, but PMW does when it's available. I kept getting segfault
crashes opening up various dialogs. Googling eventually traced these to Blt.
Hacking the PMW code to make PMW run without BLT was fairly easy and did cure
the problem.
--
Robin Becker

First  |  Prev  |  Next  |  Last
Pages: 1 2 3 4 5 6
Prev: MayaVi install
Next: How to print without spaces?