André Wobst venit, vidit, dixit 07.04.2011 23:03:
> Hi Michael,
> Am 07.04.2011 um 18:38 schrieb Michael J Gruber:
>> I'm trying to make color graphs of complex functions but seem to
>> have problems with hsb gradients. (I want to use an hsb gradient in
>> order to map arguments/phases of complex numbers to something
>> periodic, such as the meaning of h in hsb.)
> The periodicity is the problem in combination with the calculation of
> an mid point by the surface style. (And the addition of a middle
> point in the surface style is required for its typical use case,
> namely 3d plots, where you need to have planes for each mesh
> triangle. You can't use rectangles for that case, although they are
> available in PostScript and PDF. Supporting a different mesh type
> could be a solution in 2d, but is not programmed.)
> You need to replace the midcolor calculation to handle your
> periodicity. Fortunately it is possible (and trivial) to hook into
> this calculation. Please see the updated version of your example.
Thanks for the perfect explanation. I didn't know that pyx computes
midpoints between the color parameters, not the colors. (And it seemed
to work with linear rgb gradients.) Just yesterday I was teaching my
students about arg(zw) not always being arg(z)+arg(w)...
Thanks also for the working code. I had to remember to use it with
pyx@... (later than v0.10), though, and noticed 2 typos in the warnings
("gradiend" should be "gradient" no matter how soft it is). But that's
not impordand :)
> PS: This whole thread could have posted to pyx-user as well, but I
> don't mind.
Sorry, it looked like a pyx problem, while it was an mjg problem...