"empty cb range" error when only one value is returned

Frank Steiner <[email protected]> Wed, 1 May 2024 22:05:40 +0200
Newsgroups gmane.comp.graphics.gnuplot.user
Message-ID <[email protected]>
Hi,

I'm trying to plot some csv files and have problem with coloring the
bars with a helper function if the function returns only one value
instead of different ones.

Here's a very simple test scenario:

Using the files "test.csv" with content
1 1
2 2
3 3

In gnuplot 6.0 I call:
gnuplot> file="test.csv"
gnuplot> set yrange [0:3]
gnuplot> set palette defined (1  'red', 2  'green', 3  'blue')
gnuplot> color(x)=x
gnuplot> plot file using 1:2:(color($2)) with boxes fill pattern 2 lc palette

I get three bars with colors red, green and blue from left to right.

But when I change test.csv so that the values in the second column
are all "1" I get all three bars in green and the warning
"Warning: empty cb range [1:1], adjusting to [1.98:2.02]"

Same when the second colums contains only 2 or only 3: the warning
message changes w.r.t. to the numbers (e.g. range [2:2] etc.) but
the bars are always green.

Thus, when I have a csv file that causes my (more complex) color function
to return only one value, then the colors of the bars are wrong. Like a csv
file with only error values would show green (="ok") bars instead of
red (="error") ones.

Is that a bug or is my understanding of "lc palette" wrong?

Thanks!
cu,
Frank

-- 
Dipl.-Inform. Frank Steiner   Web:  http://www.bio.ifi.lmu.de/~steiner/
Lehrstuhl f. Bioinformatik    Mail: http://www.bio.ifi.lmu.de/~steiner/m/
LMU, Amalienstr. 17           Phone: +49 89 2180-4049
80333 Muenchen, Germany       Fax:   +49 89 2180-99-4049
* Rekursion kann man erst verstehen, wenn man Rekursion verstanden hat. *


_______________________________________________
gnuplot-info mailing list
[email protected]
Membership management via: https://lists.sourceforge.net/lists/listinfo/gnuplot-info