When a factor name is a prefix of another, gnuplot treats them as the same.
Hence a datafile with
0 0 0 foobar
0 1 0 foo
will lead to only one boxplot.
This patch fixes that issue.
---
diff -Naur gnuplot-5.0.0.orig/src/plot2d.c gnuplot-5.0.0/src/plot2d.c
--- gnuplot-5.0.0.orig/src/plot2d.c 2015-01-02 21:57:32.551558965 +0100
+++ gnuplot-5.0.0/src/plot2d.c 2015-01-02 21:58:13.929255645 +0100
@@ -1520,7 +1520,7 @@
len = strlen(trimmed_string);
for (label = plot->labels; label; label = label->next) {
/* check if string is the same as the i-th factor */
- if (label->text && !strncmp(trimmed_string, label->text, len))
+ if (label->text && !strncmp(trimmed_string, label->text, len + 1))
break;
}
|