On Wed, Jul 08, 2009 at 08:22:00PM -0500, Maurice LeBrun wrote:
> On Wednesday, July 8, 2009 at 11:23:23 (+0100) Andrew Ross writes:
>  > 2) When I tried to create a .pal file I realised that the current file
>  > format assumes that the position value is an integer in the range 0-100,
>  > whereas plplot actually uses a PLFLT in the range 0-1. This might not
>  > be significant for most purposes, but for example I sometimes use
>  > continuous colour scales with a narrow band of values picked out in a 
>  > different colour, either for emphasis or for ensuring that values around
>  > zero are white. The resolution offered by the .pal files might not be
>  > sufficient and I would rather not saddle us with something now that might
>  > cause problems later on. I think the original reason was that tk provided 
>  > poor float support. Let's not saddle the rest of plplot with that.
> 
> Indeed.  At the time that was written TK scale widgets only supported integer
> values, so I used integers in the 0-100 range for simplicity.  It should
> really be floating point however.  And TK scale widgets apparently support
> that now so in principle the TK support could be made compatible with the new
> format file.

Well in that case I suggest we go with floating point in the range 0-1 for the 
pos parameter. For consistency we should also ensure we do the same for the r, 
g, b values. While we are on (since this requires a new file format) perhaps we 
should also add support for the rev parameter and for HLS as well as RGB color
spaces. I've committed a straw man implementation for comment. This supports 
the 
old format .pal files, but any file which starts with v2 is assumed to be in the
new floating point format. I've also included a sample palette in the data 
directory (cmap1_blue_yellow.pal). This is one I've used in the past for 
various 
plots and I quite like. 

As yet I have not touched the tk code. It will work with the old format cmap1 
files, but not yet with the new v2 file format. cmap0 formats are unchanged.

While I was on I've also included some additional error checking for the file 
handling code in both cases.

Andrew

------------------------------------------------------------------------------
Enter the BlackBerry Developer Challenge  
This is your chance to win up to $100,000 in prizes! For a limited time, 
vendors submitting new applications to BlackBerry App World(TM) will have
the opportunity to enter the BlackBerry Developer Challenge. See full prize  
details at: http://p.sf.net/sfu/Challenge
_______________________________________________
Plplot-devel mailing list
Plplot-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/plplot-devel

Reply via email to