Search code examples
plotrgbcmykhsbpyxplot

Colour patterns or functions, pyxplot


I'm using a program called pyxplot and I'm doing some colourmaps. To specify the colors, I can use RGB, HSB or CMYK patterns using

set colourmap ( rgb<r>:<g>:<b> |
                hsb<h>:<s>:<b> |
                cmyk<c>:<m>:<y>:<k> )

All values goes from 0 to 1 and that specifies a color for the f(x,y) = c1 function. For example, I can do

       set colourmap rgb(c1):(0):(0)

and it gives me a colourmap from white to red (red for values of c1 that are 1, white for 0) I want to know if someone has an idea to form some color patterns (or if someone has some reference) like the 'jet' of Matlab of this page http://www.mathworks.com/help/techdoc/ref/colormapeditor.html Because I try to combine colors but i can't get nice patterns.

I could do

       set colourmap hsb(0.5*c1+0.1):(1):(1)

and it gives me from orange to blue on hsb range of colours, but, what if I want other colours in the range?


Solution

  • You're quite right that it didn't used to be very easy to produce custom color scales in Pyxplot 0.8. But it is now possible to do it in version 0.9.

    You need to set up a palette with a list of the colors you want along your scale. Then, rather than setting a color map in terms of RGB or HSB components, set it as an integer, to read a color from the present palette. If your palette has five colors in it, you want:

    set colormap (5-1)*c1+1
    

    For more information, including an example, see http://pyxplot.org.uk/current/doc/html/sec-palette.html