On Thu, Jun 14, 2007 at 12:34:20AM -0700, Alan Irwin wrote: > 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. :-) )
Changes commited to svn. > > > > >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? Turns out this was due to a "feature" of the wrapper generated by matwrap. I've hacked our local copy to allow zero length to arrays and now all seems to work as expected for the examples. plstyl under octave is now consistent with other bindings (e.g. java) which know about the length of arrays. > > > >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. What I actually meant is an example using more than one element in the array, for example generating a long dash - short dash line style. Just a thought... It's nice to have as many different features in the examples as possible. Andrew ------------------------------------------------------------------------- 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