What I usually do is I add two more points in $x and $y with extreme
values (-999)
and two more in color with the min value of z for the minimum color and another
one with the max of z you want. That usually solves the thing. You have to be
careful though, because pgplot will plot the values even if $x and
$color are not
the same size with unknown results.
  I am not aware of any better method, but we will see what others
have to say on this one.

  Cheers

  Xavier Calbet

  Example below:

#!/usr/bin/perl -w

use PDL;
use PDL::Graphics::PGPLOT::Window;
use PDL::Graphics::LUT;

# Generate data
$x=zeroes(100)->xlinvals(-2*3.14159,2*3.14159);
$y=$x**2;
$z=cos($x);

# Set min and max of z for colors
$minz=-2.0;
$maxz=0.8;

# Make colors
$color=$z->clip($minz,$maxz);
$color=$color->append(pdl([$minz,$maxz]));

# Make new x and y for plotting
$nx=$x->append(pdl([-999,-999]));
$ny=$y->append(pdl([-999,-999]));

# Plot
$w=pgwin('/xserve');
$w->env(min($x),max($x),min($y),max($y));
$w->ctab(lut_data('rainbow4'));
$w->points($nx,$ny,{ColorValues=>$color});
# Draw wedge
$w->_store(imag=>{routine=>"I",min=>$minz,max=>$maxz});
$w->draw_wedge();


On Sat, Jan 8, 2011 at 1:51 AM, David Whysong <[email protected]> wrote:
> I'm trying to plot a large number of points in 3 different colors, like this:
>
>
> ctab(lut_data("ramp"));
> points($x,$y,{ColorValues=>$color});
>
> Unfortunately, it seems that no matter what values I use in the $color
> array, one of them is always mapped to black. This is not what I want.
>
> Is there some way to disable the internal re-mapping of the $color
> array to the full value of the LUT?
>
> David Whysong
>
> _______________________________________________
> Perldl mailing list
> [email protected]
> http://mailman.jach.hawaii.edu/mailman/listinfo/perldl
>

_______________________________________________
Perldl mailing list
[email protected]
http://mailman.jach.hawaii.edu/mailman/listinfo/perldl

Reply via email to