I think I've got an almost complete wrapper working for the PLplot API. The
only functions not wrapped are:
plfcont, plshade1, plfshade, plgFileDevs, plgDevs, plsKeyEH, plsButtonEH,
plsexit, pltr2p, pltr0f, pltr2f, plf2eval2, plf2eval, plf2evalr, plMergeOpts,
pl?file, plgesc, pl_cmd, plFindName, plFindCommand, plGetName, plGetInt,
plGetFlt, pl*2dGrid, plGetCursor, plTranslateCursor
I believe all of those could be done with some additional effort.
I believe this wrapper will work with PLFLT set to float but I haven't tried
it.
My wrapper for plcont, plshade, and plstyl are different from those provided
by plmodule.c. Mine adhere to the C-API like this:
plcont(2Darray z, int kx, int lx, int ky, int ly, 1Darray c, callable
pltrfunc, object data)
The arrays are Numeric arrays. The "callable" is any Python function. It
should take 2 or 3 arguments and return a sequence with 2 floats. The "data"
is an arbitrary Python object.
I also wrapped pltr0, pltr1, and pltr2. They expect the "data" member above to
be a sequence with 2 Numeric arrays of appropriate dimensions.
plshade(2darray z, left, right, bottom, top, smin, smax, scmap, scolor,
swidth, min_color, min_width, max_color, max_width, rectangular, callable
pltrfunc, data)
It would be easy to add the "defined" callback to this if there is interest.
plstyl(1darray, 1darray). No first numeric argument. Pass empty list to reset.
All the examples work with this wrapper after modifications to the calls of
the above functions. The modifications make the python examples more similar
to the c examples, including the use of mypltr in xw09.py.
Anyone is welcome to this wrapper if you want it.
gb
|