Michael Schindler <michael.schindler <at> physik.uni-augsburg.de> writes:

> All PyX palettes internally use a real parameter between 0 and 1. The
> color values are defined in terms of continuous functions. What you
> want to do here, is rather a discrete definition of the palette.

Exactly. And it seems like this would be a useful addition to have,
that palettes ought to support a discrete representation.

> In order to convince PyX to use your color values, you have to do the
> following: Define functions function which interpolates all the RGB values
> from colorbrewer. This can either be a simple piecewise linear
> function or, better, a smooth approximation to it.
> Then take these three functions (one for each RGB value) and define
> a functionpalette with it, call it "accentpalette", if you like.

The problem is that the function for 4 values is different than the
function for 3 values. Think of a representation for a palette where
if I want 3 values, those values are completely different than if I 
want 4 values, which is in turn different than 5 values, etc. Thus
I don't think this technique is useful for arbitrarily defined
palettes, at least not the ones that I'd like to add. (Also, it's a
kludgey solution at best.)

I'm happy to try to add the support to PyX itself, but what I would need
explained is how the palette call gets the number of points to draw
(after all the points are accumulated, their number is somehow communicated
to the palette and I haven't been able to work out how that is done yet).

JDO



_______________________________________________
PyX-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/pyx-user

Reply via email to