On 2010-10-17 21:28-0400 Hezekiah M. Carty wrote:

> On Sun, Oct 17, 2010 at 3:12 PM, Hezekiah M. Carty

>> One suggestion I have for the API is to add a box/outline option for
>> the pllegend window (PL_LEGEND_BOX as another option for the opt
>> parameter?).  

I think this is a good idea.  The independent QSAS plot legend also
has the option of painting a bounding box for the legend.

>> I'm not sure how the color of the box should be added to
>> the API - we already get a background color argument, and I'm
>> concerned about pllegend's already long argument list becoming longer
>> with every new option added.

I would go ahead and add another argument to specify the color of the
box.  I think we just have to live with the fact that making a legend
that satisfies most people's style requirements requires a lot of
arguments (see also nrow and ncolumn discussed below).  However, large
numbers of arguments shouldn't be much of a problem for C users if we
are really smart about adopting good default values for most
parameters.  Furthermore, we will eventually want to provide some
standard smaller argument lists for pllegend for those language
bindings that have function overloading.  So let's keep these general
possibilities in mind, but wait to do any detailed implemention of
default values and/or function overloading until the fundamental
API is completely settled.

>>
>
> I have started work on the plcolorbar API.  I don't expect to have it
> done today, but it did bring up some API/functionality changes I would
> like to propose for pllegend (and use in plcolorbar).
>
> 1. I think it is worth considering different ways of expressing the
> position of a legend or color bar.  For example, in the OCaml color
> bar API, the position of the color bar is specified relative to a
> user-specified plot subpage boundary.  This could be done in the C API
> with another set of options for the "opt" parameter: PL_LEGEND_TOP,
> PL_LEGEND_BOTTOM, PL_LEGEND_LEFT, PL_LEGEND_RIGHT and possibly
> PL_LEGEND_CENTER.  The position arguments would then be interpreted as
> offsets from the given side.  For example:
>
> PL_LEGEND_BOTTOM | PL_LEGEND_RIGHT : Position the box relative to the
> bottom-right of the plot subpage
>
> PL_LEGEND_RIGHT | PL_LEGEND_CENTER : Position the box relative to the
> right side of the plot subpage, centered vertically (the y-position
> would be ignored in this case)
>
> The default would continue to be PL_LEGEND_TOP | PL_LEGEND_LEFT.  I
> expect PL_LEGEND_CENTER to be more commonly used with plcolorbar.

Sounds good.

> 2. Allow a user to specify if they want the legend positioned relative
> to the plot window or the plot subpage (PL_LEGEND_PAGE or
> PL_LEGEND_WINDOW?).  The position would be (possibly normalized) plot
> window coordinates for PL_LEGEND_WINDOW and normalized subpage
> coordinates for PL_LEGEND_PAGE.  Sizes/lengths would probably still be
> specified as normalized subpage coordinates.

The QSAS team brought up this issue as well.  I think you guys are
right so let's just drop the PL_LEGEND_PAGE and PL_LEGEND_WINDOW
control bits and instead always specify the x, y position, and length
of plotted area in normalized window coordinates.  Then to go outside
the window you simply set an x position or y position of less than 0
or greater than 1.

>
> I expect most of the "opt"-appropriate options to be shared between
> pllegend and plcolorbar.
>
> If the rest of you feel that these changes are reasonable, I am
> willing to make or help make the required changes to the C
> implementation of pllegend.

Please go ahead.

After you have completed those C API changes, there is one additional
change (rows and columns in the legend, again suggested by what the
QSAS legend does) that I want to implement as well.  I am thinking of an API
where you specify nrow and ncolumn.  Normally, the nrow by ncolumn
cells would be filled in column-major order with nlegend <=
nrow*ncolumn entries, but if the PL_LEGEND_ROW_MAJOR bit were set, the
cell filling would be done in row-major order rather than the default
column-major order.

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
__________________________

------------------------------------------------------------------------------
Download new Adobe(R) Flash(R) Builder(TM) 4
The new Adobe(R) Flex(R) 4 and Flash(R) Builder(TM) 4 (formerly 
Flex(R) Builder(TM)) enable the development of rich applications that run
across multiple browsers and platforms. Download your free trials today!
http://p.sf.net/sfu/adobe-dev2dev
_______________________________________________
Plplot-devel mailing list
Plplot-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/plplot-devel

Reply via email to