Pregunta

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?

¿Fue útil?

Solución

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

Otros consejos

You can use a colormap of linear interpolation between colors: dark blue (0,0,0.5), blue (0,0,1), cyan (0,1,1), yellow (1,1,0), red (1,0,0), dark red (0.5,0,0).

This is mostly the "jet" like colormap (if you omit dark blue and dark red colors) but look a bit more interesting. Exactly this color scheme is used by default in MathGL (GPL plotting library).

HSB is probably the best and easiest color system to play with, in particular the Hue (H) component as you tried. It should start with red, continue with yellow, green, cyan, blue, magenta and return to red.

You should easily get the other colors if you simplify your colormap to (assuming that c1 goes from 0 to 1):

set colourmap hsb(c1):(1):(1)

The current formula 0.5 * c1 + 0.1 for the H component restricts it to the range from orange via yellow, green and cyan to blue.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top