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 have brought up the central legend-drawing topic because I noticed
plplot.ml contained the draw_legend function which uses the result
from the character_height function beginning on line 611 to draw a
legend.  The octave interface also has a legend-drawing capability,
and it appears that the original poster on plplot-general also has a
need for that capability in Perl/PDL.  If not obvious already, it
appears from all these lines of evidence that PLplot needs a
legend-drawing capability in its core library.

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.

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 Dev2Dev email is sponsored by:

Show off your parallel programming skills.
Enter the Intel(R) Threading Challenge 2010.
http://p.sf.net/sfu/intel-thread-sfd
_______________________________________________
Plplot-devel mailing list
Plplot-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/plplot-devel

Reply via email to