Find the answer to your Linux question:
Results 1 to 5 of 5
Hi there Does anybody know of a plotting program on linux (I use Debian) that accepts missing values (NaN, NA, undef,...) and ignores them on a plot? I've tried several ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    fab
    fab is offline
    Just Joined!
    Join Date
    Mar 2005
    Posts
    3

    Plotting data that include NaN


    Hi there

    Does anybody know of a plotting program on linux (I use Debian) that accepts missing values (NaN, NA, undef,...) and ignores them on a plot? I've tried several programs (xmgrace, octave, labplot). Each accepts the NaN's but when plotting the data it either sets the value to +Inf or connects the two bordering points. I'm looking for a program that line-connects only points with no missing values in between and leaves a blank spot on the plot when encountering NaN's (like Grapher or Origin on Windows).

    Thank you
    fab

  2. #2
    Linux Guru
    Join Date
    Mar 2003
    Location
    Wisconsin
    Posts
    1,907
    Registered Linux user #346571
    "All The Dude ever wanted was his rug back" - The Dude

  3. #3
    fab
    fab is offline
    Just Joined!
    Join Date
    Mar 2005
    Posts
    3
    Quote Originally Posted by jeremy1701
    I guess the Gunplot function is the same as is used in octave and the graph function doesn't work either. But thanks anyway

  4. #4
    Linux Guru
    Join Date
    Mar 2003
    Location
    Wisconsin
    Posts
    1,907
    Create a small awk script that runs through your file and deletes each point value that contains a NaN or Na.

    1,2
    1,3
    2,4
    3,na
    4,5

    would then be

    1,2
    1,3
    2,4
    4,5

    and your problem would be solved.

    Jeremy
    Registered Linux user #346571
    "All The Dude ever wanted was his rug back" - The Dude

  5. #5
    fab
    fab is offline
    Just Joined!
    Join Date
    Mar 2005
    Posts
    3
    Yes. Unfortunately I've got block data with multiple columns with missing values at various places and it would be a mess to break it up to make one file for each column

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •