On Tue, Aug 18, 2009 at 6:42 PM, Alan W. Irwin<ir...@beluga.phys.uvic.ca> wrote:
> On 2009-08-18 16:45-0500 Hezekiah M. Carty wrote:
>
>> PLplot has apparently had, for some time, a commented-out alternate
>> color map 0 with a white background and multiple foreground colors.  I
>> think that this, or a similar cmap0, is worth including with PLplot.
>
> I agree that looks pretty good and is worth preserving as yet another
> palette file.

Committed as revision 10290.  I left the name as cmap0_alternate.pal
for now.  The filename can be changed later to match whatever scheme
we decide on.

>> Is it worth adding a PLplot cmake/compile-time option to change the
>> default color map 0 to this or some other alternate?  This would allow
>> someone who wants white backgrounds to be the rule rather than the
>> exception to avoid having to set the palette for each plot.
>
> I think this is a good idea.  The DEFAULT_CMAP0_FILE and DEFAULT_CMAP1_FILE
> options (to pick some reasonable names for those cmake options) should just
> be a PLplot builder-specified string corresponding to one of the existing
> cmap[01] palette files in the standard places where palette files appear
> (which includes the current directory for those who really want to play with
> colour schemes). If those options were not specified, then the fallback for
> the default would be the existing cmap[01]_default.pal files which give the
> default colour scheme that our traditional users expect.
>
> Such a change would also allow us to do the initial setup of cmap0 and cmap1
> when libplplot is opened using the specified default palette files.  I feel
> such use of palette files to initialize cmap[01] is an improvement over the
> current hard-coded specification of the default cmap0 and cmap1 when
> libplplot is opened.

Committed as revision 10298.

A user can now configure PLplot with:

cmake -DDEFAULT_CMAP0_FILE=cmap0_alternate.pal
-DDEFAULT_CMAP1_FILE=cmap1_blue_yellow.pal ...

or any other cmap0 and/or cmap1 file to change the default PLplot
colors.  If these options are not provided then the existing default
colors are used (black background for cmap0, blue -> black -> red for
cmap1).

A few notes on this change:
1. All color palettes are now loaded from disk, even the defaults when
no user configuration is provided.

2. As a result of (1), color map 1 will not adjust to a change in the
background color of color map 0 since both are loaded from disk.

3. The existence of the default color map files is not checked by
cmake.  I left this out because a user may want to use
non-PLplot-provided color maps as their defaults.  Would a cmake-time
warning be appropriate here, to catch cases of mistyped filenames of
the included color palettes?

This is a relatively simple change to the PLplot code, and it all
seems to work properly on my system.  It affects some fairly central
pieces of PLplot though, so I think it deserves some scrutiny from
others if you have the time.

Thanks,

Hez

-- 
Hezekiah M. Carty
Graduate Research Assistant
University of Maryland
Department of Atmospheric and Oceanic Science

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Plplot-devel mailing list
Plplot-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/plplot-devel

Reply via email to