#1274 invalid points in data that is made monotonic

None
closed-fixed
nobody
None
2016-09-06
2013-08-14
No

When the data for a plot with "smooth frequency" contains at least one value twice, then a table output contains one additional invalid last line.

This comes in while rendering the data monotonic, same happens for smoothing options unique, cumulative and cnormal. The problem is in the function cp_implode() in interpol.c:1311. The invalid point is created to separate data blocks and -sets.

A partial fix would be to not do this for the last block/set, but that condition is not known beforehand. If all points in a set are already unique, a blank line appears after it in the output, which is of course desireable.

set table
plot '-' using 1:(1) smooth freq 
1
2

1
1
6

2
2
4
e
unset table

gives

# Curve 0 of 1, 9 points
# Curve title: "'-' using 1:(1)"
# x y type
1 1  i
2 1  i

1 2  i
6 1  i
6 1  u
2 2  i
4 1  i
2 1  u

Discussion

  • Karl Ratzsch

    Karl Ratzsch - 2013-08-14
    • Description has changed:

    Diff:

    --- old
    +++ new
    @@ -13,9 +13,9 @@
     gives
    
     ===
    -# Curve 0 of 1, 3 points
    -# Curve title: "'-' using 1:(1)"
    -# x y type
    +\# Curve 0 of 1, 3 points
    +\# Curve title: "'-' using 1:(1)"
    +\# x y type
      1  2  i
      6  1  i
      6  1  u
    
     
  • Karl Ratzsch

    Karl Ratzsch - 2014-03-23

    My description was very strange, and this should have been filed as a bug report.

    P.S. Still the same in 4.6.5 (windows -rc2 build), so it seems unrelated to that bug with an invalid value after a blank line in the data file

     
    Last edit: Karl Ratzsch 2014-03-23
  • Karl Ratzsch

    Karl Ratzsch - 2014-03-23
    • summary: table output with boxes --> table output contains additional invalid line
     
  • Karl Ratzsch

    Karl Ratzsch - 2015-04-21
    • summary: table output contains additional invalid line --> invalid points in data that is made monotonic
    • Description has changed:

    Diff:

    --- old
    +++ new
    @@ -1,23 +1,38 @@
     When the data for a plot with "smooth frequency" contains at least one value twice, then a table output contains one additional invalid last line.
    
    -===
    -set table
    -plot '-' using 1:(1) smooth freq 
    -1
    -1
    -6
    -e
    -unset table 
    -===
    +This comes in while rendering the data monotonic, same happens for smoothing options unique, cumulative and cnormal. The problem is in the function cp_implode() in interpol.c:1311. The invalid point is created to separate data blocks and -sets.
    +
    +A partial fix would be to not do this for the last block/set, but that condition is not known beforehand. If all points in a set are already unique, a blank line appears after it in the output, which is of course desireable.
    +
    +    set table
    +    plot '-' using 1:(1) smooth freq 
    +    1
    +    2
    +
    +    1
    +    1
    +    6
    +
    +    2
    +    2
    +    4
    +    e
    +    unset table 
    +
    
     gives
    
    -===
    -\# Curve 0 of 1, 3 points
    -\# Curve title: "'-' using 1:(1)"
    -\# x y type
    - 1  2  i
    - 6  1  i
    - 6  1  u
    -===
    +    # Curve 0 of 1, 9 points
    +    # Curve title: "'-' using 1:(1)"
    +    # x y type
    +    1 1  i
    +    2 1  i
    
    +    1 2  i
    +    6 1  i
    +    6 1  u
    +    2 2  i
    +    4 1  i
    +    2 1  u
    +
    +
    
    • Group: -->
    • Priority: 5 -->
     
  • Matthew Halverson

    I'm seeing this in 5.0.3

    Doing the following:

    $k << EOD
    1 2
    1 8
    2 9
    2 1
    3 9
    3 10
    EOD
    
    set table
    plot $k u 1:2 smooth frequency
    

    produces

    # Curve 0 of 1, 4 points
    # Curve title: "$l u 1:2"
    # x y type
    1 10 i
    2 10 i
    3 19 i
    2 9 u
    

    I have wanted to use this to capture the smoothing output into a named data block and plot that, coloring the result according to the smoothed value, but this extraneous line prevents that. It is possible to use the third column and test for a value not 'u', but this is annoying.

     
  • Ethan Merritt

    Ethan Merritt - 2016-09-06
    • status: open --> closed-fixed
     

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.





No, thanks