bugGNU Octave - Bugs: bug #45631, Line dissapear from plot when...

 
 

bug #45631: Line dissapear from plot when modifying "plotboxaspectratio"

Submitter:  None
Submitted:  Sun 26 Jul 2015 12:14:00 PM UTC
   
 
Category:  Plotting Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Incorrect Result
Status:  Fixed Assigned to:  None
Originator Name:  Originator Email:  -email is unavailable-
Open/Closed:  * Closed Release:  * dev
Operating System:  * GNU/Linux Fixed Release:  None
Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Mon 14 Jan 2019 12:32:59 AM UTC, comment #4: 

This has been fixed somewhere in the past.  Upgrade to the about-to-be-released version 5.0 to see the fix.  Closing report.

Rik <rik5>
Group administrator
Thu 29 Dec 2016 10:28:03 PM UTC, comment #3: 

This issue is still present in Octave 4.2.0.

The plot command and data in comment #0 still produce an empty plot for me (graphics_toolkit qt).

Hartmut <hardy>
Tue 28 Jul 2015 04:52:46 PM UTC, comment #2: 

Need to narrow this down a bit.

1) Does this work if you use the gnuplot toolkit? (does for me)
2) Does this work if you manually change the axis limits after the end of plotting to something larger than the data such as axis ([1 3 1 3])?
3) dataaspectratio and pbaspectratio are very interellated.  See http://www.mathworks.com/help/matlab/ref/axes-properties.html?nocookie=true#prop_DataAspectRatio for extensive documentation.  Do you need to set plotboxaspectratio to ([1 1 1]) if you have already set dataaspectratio to ([1 1 1])?  Using your example, and commenting out dataaspectratio and plotboxaspectratio, I find that only one of the commands is needed to produce a square plot.  I think that may be the quickest workaround.

Rik <rik5>
Group administrator
Sun 26 Jul 2015 12:32:03 PM UTC, comment #1: 

Additional info:

It appears like the property does affect what can be drawn. With dots instead of a line, the some part of the "line" is clipped.

Anonymous
Sun 26 Jul 2015 12:14:00 PM UTC, original submission:  

This bug is present in booth 3.8.1 and 4.0.0. It also affect both FLTK and Qt.

When modifying "plotboxaspectratio", it becomes impossible to draw a line. Only dots works. It only appears for certain input data, suggesting some bad rounding.

The script:


load mod34_beta2.mat;
tab1=tab;
load mod34_beta.mat;
corrplot(tab(:,4),tab1(:,4),'X','X',1,1);
corrplot(tab(:,7),tab1(:,7),'X','X',1,1);


The helper function exploiting the bug


function corrplot(X,Y,x_label,y_label,X_scale,Y_scale)
        P=polyfit(X,Y,1);
        x=linspace(min(X),max(X),64);
        plot(X/X_scale,Y/Y_scale,'.','markersize',4);
        hold on
        if(strcmp(x_label,y_label))
                set(gca(),'dataaspectratio', [1, 1, 1]);
                set(gca(),'plotboxaspectratio', [1,1,1]); %(1) Works without this line
        end
        plot(x/X_scale,polyval(P,x)/Y_scale,'--'); % With (1), this command has no effect, changing '--' to '.', or removing (1) and it works
        drawnow
        xlabel(x_label);
        ylabel(y_label);
        hold off

end


The bug affects `axis equal` since it sets the affected property.

Anonymous

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

Attached Files
file #34529:  mod34_beta.mat added by None (4KiB - application/octet-stream - Files with data)
file #34530:  mod34_beta2.mat added by None (4KiB - application/octet-stream - Files with data)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by hardy (Posted a comment)
  • -email is unavailable- added by rik5 (Posted a comment)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only group members can vote.

     

    Follow 6 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2019-01-14 rik5 StatusConfirmed Fixed
        Open/ClosedOpen Closed
    2015-07-28 rik5 StatusNone Confirmed
        Release3.8.1 dev
    2015-07-26 None Attached File- Added mod34_beta.mat, #34529
        Attached File- Added mod34_beta2.mat, #34530

    Back to the top

    Powered by Savane 3.13-758e.
    Corresponding source code