On Thu, Sep 9, 2010 at 3:00 PM, Alan W. Irwin <ir...@beluga.phys.uvic.ca> wrote: > I am transferring this discussion from plplot-general to plplot-devel > with a different subject. > > On 2010-09-09 10:36-0400 Hezekiah M. Carty wrote: > >> The OCaml bindings include a character_height function which (should?) >> return the character height in world coordinates: >> >> >> http://plplot.svn.sourceforge.net/viewvc/plplot/trunk/bindings/ocaml/plplot.ml?revision=11020&view=markup >> >> The function begins on line 611 and should be fairly self-explanatory. >> There is likely a simpler way to do this using internal PLplot >> functions, but this method allows you to stick to the public, >> documented API. >> > > I am not that good at reading OCaml code, but it looks like the method > combines results from plgch, plgvpd, plgspa, and plgvpw. From the > documentation of those, you should be able to use the combination of > plgspa and plgvpd to obtain the viewport limits in mm. Then combine > those results with plgvpw results (which obtains the viewport limits > in world coordinates) to determine the ratio of world coordinates to > mm in the y direction. Then use that factor to transform plgchr > height results in mm to world coordinates. So I think this idea > should work fine, but it would not be necessary if we had a central > libplplot pllegend capability which simply accessed the required > internal variables directly. >
I think I'll stick with a direct port using the public API for the first pass. This can be relaxed once the port to C is working acceptably. > Hez, from your OCaml experience with legends would you be willing to > implement a legend-drawing capability in libplplot and also modify one > of our C examples to use that new API? (I assume from here on that > that new function would be called pllegend.) If you were willing to do > that implementation, I (and presumably others from past history) would > be willing to help out afterward with the usual API addition tasks of > pllegend documentation and propagating the pllegend API and its use in > a standard example to all our languages. I believe the ultimate > result of a well-documented and uniform pllegend capability for all > our languages would be a welcome improvement to PLplot. > I'll give it a shot. The current OCaml version is purely for line-plot legends. It should be fairly straightforward to generalize the function to allow either line or point/symbol legends from the same function. I've started a src/pllegend.c. I'll reply to this thread once I have an initial test version checked in to trunk. Hez ------------------------------------------------------------------------------ Start uncovering the many advantages of virtual appliances and start using them to simplify application deployment and accelerate your shift to cloud computing http://p.sf.net/sfu/novell-sfdev2dev _______________________________________________ Plplot-devel mailing list Plplot-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/plplot-devel