Menu

#2877 "plot binary" plots one more point than there is data for

None
open
nobody
None
1 day ago
1 day ago
No

Version Information

Tried this using Gnuplot 6.0 patchlevel 4 on Windows 11, downloaded from https://sourceforge.net/projects/gnuplot/files/latest/download (the "Download Latest Version" button mentioned "gp604-win64-clang.exe), and using Gnuplot 6.0.3 patchlevel 3 on Fedora Linux 43 running in WSL2 on that same Windows 11 system. Got the same results in both cases.

The Problem

The gnuplot "plot" command plots one more data point than there is data for in a binary file.

Reproduction Scenario

I prepared a binary data file test12.dat (attached) containing the values 10 through 21 in "double" format; i.e., 12 successive values starting at 10; the data file is 96 (= 12×8) bytes in size. I then ran gnuplot command

plot 'test12.dat' binary format='%2double' using 1:2 pointtype 4

Observed Behavior

The generated plot doesn't just show the expected 6 data points at coordinates (10,11), (12,13), …, (20,21), but also an extra data point of which the coordinates aren't always the same. I saved one such plot in file gnuplot-bug.svg and attached it to this ticket.

Expected Behavior

Only the 6 data points corresponding to the data values in the binary file should be displayed.

2 Attachments

Discussion

  • Louis Strous

    Louis Strous - 1 day ago
    • Attachments has changed:

    Diff:

    --- old
    +++ new
    @@ -1 +1,2 @@
     gnuplot-bug.svg (51.5 kB; image/svg+xml)
    +test12.dat (96 Bytes; application/octet-stream)
    
    • Group: -->
    • Priority: -->
     
  • Louis Strous

    Louis Strous - 1 day ago
    • summary: "plot binary" plots one more point that there is data for --> "plot binary" plots one more point than there is data for
     
  • Hiroki Motoyoshi

    I believe the extra point is being displayed as part of the key (legend) to explain the data points.

    You can remove it by using:

    unset key
    plot 'test12.dat' binary format='%2double' using 1:2 pointtype 4
    

    Alternatively, you can make it clear that it is a legend by running:

    set key box
    plot 'test12.dat' binary format='%2double' using 1:2 pointtype 4
    

    You can learn more about how to use key by typing the following at the prompt:

    gnuplot> ? set key
    
     

    Last edit: Hiroki Motoyoshi 24 hours ago

Log in to post a comment.

Monday.com Logo