|
From: Juhász P. <pet...@gm...> - 2020-03-19 22:17:34
|
Hi,
Today I've tried to create a heatmap from a CSV-ish file that contained
more than one blocks of data, and I've naively thought that I can
combine `plot ... index N` with `plot ... matrix rowheaders
columnheaders w image`. Admittedly, it's an edge case, but it's not
explicitly mentioned as illegal either.
Unfortunately, it doesn't work:
for small files it produces an empty plot with some error messages, and
for large files it crashes.
The following one-liner will create a file that can be used to
reproduce the crash:
perl -le '$N=100; $,=v9; for (1..2) {print "x",qw(a b)x$N; print
"a",(1,2)x$N for 1..$N; print"" for 1..2}' > /tmp/foo
then in gnuplot,
plot '/tmp/foo' i 0 matrix rowheaders columnheaders w image
Decrease the value of $N in the one-liner to generate a file that
doesn't crash, for me the threshold was 26.
gnuplot version: 5.5 patchlevel 0 last modified 2019-12-22
The crash happens in graphics.c:process_image.
So it appears that `index` doesn't cooperate with `matrix` - I can
accept that this combination is not supported but then there should be
a note about the fact in the documentation. And it shouldn't crash in
any case.
best regards,
Peter Juhasz
|