In CVS version, the combination of palette options
"defined" and "maxcolors" causes broken color palette.
For example, the following code generates unequal sized
color scale for x11.
---
set palette defined ( 0 '#000090', \
1 '#000fff', \
2 '#0fffee', \
3 '#90ff70', \
4 '#ffee00', \
5 '#ff7000', \
6 '#7f0000')
set palette maxcolors 4
set cbrange [-1:1]
plot "+" using ($1):(sin($1)):(sin($1)) with points palette
pause -1
---
My environment is
G N U P L O T Version 4.7 patchlevel 0 last modified 2012-05-21 Build System: Darwin i386
Screen shot drawn by sample script
Duplicate of [invalid] Bug #3305600
You must give the start and end point for each color range.
maxcolors is not important, but it must be at least as large as the number of color ranges.
I think the commands you want are:
set palette defined ( 0 '#000090', 0 '#000090',\ 0 '#000fff', 1 '#000fff', \ 1 '#0fffee', 2 '#0fffee', \ 2 '#90ff70', 3 '#90ff70', \ 3 '#ffee00', 4 '#ffee00', \ 4 '#ff7000', 5 '#ff7000', \ 5 '#7f0000', 6 '#7f0000')
set cbrange [-1:1]
plot "+" using ($1):(sin($1)):(sin($1)) with points palette
Sorry. Typo in suggested palette definition. Try
set palette defined ( \ -1 '#000090', 0 '#000090',\ 0 '#000fff', 1 '#000fff', \ 1 '#0fffee', 2 '#0fffee', \ 2 '#90ff70', 3 '#90ff70', \ 3 '#ffee00', 4 '#ffee00', \ 4 '#ff7000', 5 '#ff7000', \ 5 '#7f0000', 6 '#7f0000')
If you change maxcolors as large as color number specified in 'defined' such like,
# set palette maxcolors 4
set palette maxcolors 11
it generate strange color palette.
I'll attach the screenshot for this.
Screen shot for the case "maxcolors 11"
In addition, the problem occurs not only in terminal X11 but also in other terminals (wxt, pdfcairo, pdf, gif).
All right, this bug report pointed out same problem with #3305600.
Please close this report.