Skip to content

NaN behaviour #18

Description

@cfedk

There is inconsistent behaviour when plotting NaN values vs Inf values:

require 'gnuplot'
a=torch.rand(5)
a[2] = 0/0
a[4] = 1/0
gnuplot.plot(a)
gnuplot.axis({0,5,0,2})

This produces the following:

untitled

The item at a[4] (Inf) is not drawn. That's great. However, the item at a[2] (NaN) is drawn - but at x=1. When plotting any NaN value a[i]=NaN, this will be plotted as (x,y) = (i-1,i), which is weird.

Of course this is not a major problem - let's concentrate on fixing the code that's producing NaN! - but it is an oddity to be aware of I think. Perhaps this is well known behaviour in gnuplot, though.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions