#1248 manual bug for binary matrix

5.0
closed-accepted
nobody
None
5
2013-07-01
2013-06-10
Shigeharu TAKENO
No

The binary matrix data is explained in gnuplot.doc that the data

   <N+1>  <y0>   <y1>   <y2>  ...  <yN>
    <x0> <z0,0> <z0,1> <z0,2> ... <z0,N>
    <x1> <z1,0> <z1,1> <z1,2> ... <z1,N>
     :      :      :      :   ...    :

is converted into triplets:
<x0> <y0> <z0,0>
<x0> <y1> <z0,1>
<x0> <y2> <z0,2>
: : :
<x0> <yN> <z0,N>

   <x1> <y0> <z1,0>
   <x1> <y1> <z1,1>
    :    :     :

But, gnuplot seems to treat it as:

   <y0> <x0> <z0,0>
   <y0> <x1> <z0,1>
   <y0> <x2> <z0,2>
    :    :     :
   <y0> <xN> <z0,N>

   <y1> <x0> <z1,0>
   <y1> <x1> <z1,1>
    :    :     :

Sample program bindata.c in the attached archive file puts the
binary file:

2.0, 0.0, 1.0,
20.0, 0.0, 10.0,
21.0, 1.0, 12.0,
22.0, -3.0, 9.0

According to the manual section "binary matrix", this data should
be interpreted as:
20.0 0.0 0.0
20.0 1.0 10.0

21.0 0.0 1.0
21.0 1.0 12.0

22.0 0.0 -3.0
22.0 1.0 9.0

However, gnuplot treats it as
0.0 20.0 0.0
1.0 20.0 10.0

0.0 21.0 1.0
1.0 21.0 12.0

0.0 22.0 -3.0
1.0 22.0 9.0

(please see bindata.gp and bindata.png)

So, I think we should change the manual rather for the original
data than for the converted data to

   <N+1>  <x0>   <x1>   <x2>  ...  <xN>
    <y0> <z0,0> <z0,1> <z0,2> ... <z0,N>
    <y1> <z1,0> <z1,1> <z1,2> ... <z1,N>
     :      :      :      :   ...    :
1 Attachments

Discussion

  • Ethan Merritt
    Ethan Merritt
    2013-06-11

    This bug is the same as bug 866, right?

     
  • Yes. I did not know the previous report was remained.

    I send a patch for the source code to adjust to the manual
    at that time, but now I think it is better to adjust the
    manual to the real feature.

     
  • Ethan Merritt
    Ethan Merritt
    2013-07-01

    • status: open --> closed-accepted
     
  • Ethan Merritt
    Ethan Merritt
    2013-07-01

    OK