octave-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Octave-bug-tracker] [bug #55506] Plotting fails using large number with


From: anonymous
Subject: [Octave-bug-tracker] [bug #55506] Plotting fails using large number with small increments.
Date: Fri, 18 Jan 2019 08:24:31 -0500 (EST)
User-agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:64.0) Gecko/20100101 Firefox/64.0

URL:
  <https://savannah.gnu.org/bugs/?55506>

                 Summary: Plotting fails using large number with small
increments.
                 Project: GNU Octave
            Submitted by: None
            Submitted on: Fri 18 Jan 2019 01:24:29 PM UTC
                Category: Plotting
                Severity: 3 - Normal
                Priority: 5 - Normal
              Item Group: Incorrect Result
                  Status: None
             Assigned to: None
         Originator Name: 
        Originator Email: 
             Open/Closed: Open
         Discussion Lock: Any
                 Release: 4.2.2
        Operating System: GNU/Linux

    _______________________________________________________

Details:

The following code produces the attached plot:
x = 1e6:1e-4:1e6+1;
y = sin(x*1e3);
plot(x,y)

I would expect to see a simple sinusoid with lots of periods displayed and an
amplitude of 1. The plot that is generated clearly isn't this. 

It looks like the plotting algorithm can only distinguish values with a 0.125
resolution if they have an absolute value of 1million. This corresponds to a
ratio of 8million between the absolute size of the values I'm trying to plot
and the difference between them. 

I believe that the actual ratio will be 2^23, as this is roughly 8million and
corresponds to the number of bits contributing to the decimal part of a single
precision variable. I'm guessing the plotting algorithm uses single precision
variables which is causing the problem here. 

MATLAB is capable of plotting these values correctly, so I'm guessing uses
double precision variables in its processing and this could be improved if
Octave were to do the same. 

I understand there will always be a limit at which this will occur, but I came
across this issue in my everyday work so would appreciate it being fixed.



    _______________________________________________________

File Attachments:


-------------------------------------------------------
Date: Fri 18 Jan 2019 01:24:29 PM UTC  Name: OctavePlotFail.png  Size: 12KiB  
By: None

<http://savannah.gnu.org/bugs/download.php?file_id=46004>

    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?55506>

_______________________________________________
  Message sent via Savannah
  https://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]