#348 pm3d-plot with HSV color space

closed-fixed
nobody
None
5
2012-11-04
2012-10-17
Joachim Seibt
No

Hello,

Maybe someone can help me with the following issue:

I'm trying to plot a complex quantity z which depends on two variables x and y in form of a pm3d-plot,
where the phase phi(z) of the complex values is aimed to be encoded a color from the hue-scale,
while the amplitude A(z) of the complex values determines the intensity of that color.

The data are read from a file with specification of

x y phi(z) A(z)

in each column, where x changes slow and y changes fast.

The most obvious solution (at least from my point of view) to choose the option

u 1:2:3:4

in combination with "splot" after definition of the color scheme via

set palette model HSV functions gray,1,1

did not yield the desired result. Then just the phase is plotted regardless of the amplitude.

If you have an idea how to proceed, please let me know.

Thank you,

Joachim

Discussion

  • Ethan Merritt
    Ethan Merritt
    2012-10-17

    Here you go.
    This is a script written to diagnose errors in the inverse trig functions applied to complex numbers. It defines an HSV coloring scheme and uses it to plot the phase of the complex value return by a function.

     
  • Ethan Merritt
    Ethan Merritt
    2012-10-17

    Coloring scheme for phase of complex values

     
    Attachments
  • Ethan Merritt
    Ethan Merritt
    2012-10-21

    Your request has inspired me to revist an old patch from Shige Takeno and re-implement it via a new user-callable function hsv2rgb(h,s,v). The patch itself is
    #3578796.

    I've also revised the complex_trig demo to use the new function. It assigns colors to the complex plane, with Hue representing the phase angle and Saturation representing the vector amplitude. An on-line copy of the output is here:

    http://gnuplot.sourceforge.net/demo_cvs/complex_trig.html

     
  • Ethan Merritt
    Ethan Merritt
    2012-11-04

    • status: open --> closed-fixed