On 2007-06-14 07:58+0100 Andrew Ross wrote:

>
> While trying to produce some research plots of my own I discovered that
> plstyl does not work correctly in the octave bindings. The definition of
> the function bindings/octave/plplot_octave.h.in is wrong. As a result
> the mark and space arguments are not treated as arrays and you have to
> explicitly pass the nms parameter. Of course this works fine for cases
> where nms is 0 or 1 and so mark and space are not arrays. Unfortunately
> this covers all the plplot examples and so this has not been picked up
> before.
>
> The change to "fix" this is relatively simple - just add
> //%input mark(nms), space(nms)
> to the end of the function definition, however
>
> 1) It removes the nms argument so this is an interface change.

I wouldn't be too concerned about this issue especially for the octave
interface that has historically been built on an octave API quicksand.
(Of course, two wrongs don't make a right, but our minor wrong might
be lost in the noise.  :-) )

>
> 2) It is no longer possible to pass zero length arrays of mark / space
> lengths, which is the recommended way to reset to a continuous line. I
> tried it but the octave bindings don't seem to treat [] as of zero
> length. I don't understand this since size([]) in octave does produce 0.

I am not an octave guru, but on general principles could you do the right
thing using an octave wrapper for plstyl such that the wrapper detects when
size(mark) is zero?

>
> Any octave gurus out there able to help? Any similar problems with other
> bindings which use array length to get dimensions?

Example 9 resets to a continuous line so each language that replicates the C
example result for example 9 should be OK by definition.  BTW, I just
changed the plstyl documentation so it has the correct redacted form without
the array dimension.  In retrospect I perhaps should have made an additional
comment about a zero-length array for the redacted form doing what you
expect (resets to continuous line), but it may be too obvious to worry about.

>
> Andrew
>
> P.S. As an aside, it would be nice to include an example of using plstyl
> with an array in the demos to test this feature. I would also be useful
> to illustrate it's use.

Example 9 does this already.

Alan
__________________________
Alan W. Irwin

Astronomical research affiliation with Department of Physics and Astronomy,
University of Victoria (astrowww.phys.uvic.ca).

Programming affiliations with the FreeEOS equation-of-state implementation
for stellar interiors (freeeos.sf.net); PLplot scientific plotting software
package (plplot.org); the libLASi project (unifont.org/lasi); the Loads of
Linux Links project (loll.sf.net); and the Linux Brochure Project
(lbproject.sf.net).
__________________________

Linux-powered Science
__________________________

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Plplot-devel mailing list
Plplot-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/plplot-devel

Reply via email to