bugGNU Octave - Bugs: bug #53647, Order of plot commands xlabel,...

 
 

bug #53647: Order of plot commands xlabel, hold & plot fcts

Submitter:  Charles Praplan <charprap>
Submitted:  Sat 14 Apr 2018 07:23:13 AM UTC
   
 
Category:  Plotting with OpenGL Severity:  3 - Normal
Priority:  3 - Low Item Group:  Incorrect Result
Status:  Fixed Assigned to:  None
Originator Name:  Charles Praplan Open/Closed:  * Closed
Release:  * 4.2.2 Operating System:  * Microsoft Windows
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Thu 25 Oct 2018 02:49:39 PM UTC, comment #3: 

This is a duplicate of bug #48718 which has been fixed.

Closing report as fixed

Pantxo Diribarne <pantxo>
Group Member
Sat 14 Apr 2018 01:09:14 PM UTC, comment #2: 

For someone who comes along later and is debugging this, the problem is the axes object position property which is not set correctly.

Using


set (gca, 'position', [0.13, 0.11, 0.775, 0.815])


will restore a normal-looking plot.

Rik <rik5>
Group administrator
Sat 14 Apr 2018 01:07:46 PM UTC, comment #1: 

Yes it does.  Best practice for Octave is to first plot your data, and then annotate the graph with labels, titles, etc.  If you reverse the order of the code it works just fine.


figure;
fs=1e6;
plot([1:1000]/fs, [1:1000].^2);
hold on;
xlabel('Time [s]');


As an added bonus, there is no need to use the 'hold on' command since xlabel will not clear the figure window.  So the shorter, working code is


figure;
fs=1e6;
plot([1:1000]/fs, [1:1000].^2);
xlabel('Time [s]');


Marking this as confirmed since it is reproducible, but lowering the priority since there is a simple workaround.

Rik <rik5>
Group administrator
Sat 14 Apr 2018 07:23:13 AM UTC, original submission:  

Following code produces a buggy figure!

figure;
fs=1e6;
xlabel('Time [s]');
hold on;
plot([1:1000]/fs, [1:1000].^2);



Remarks :

- this happens with 'qt' and 'fltk' graphics_toolkit
- ok with fs=1e5
- ok without "xlabel('Time [s]');"
- ok without "hold on"

Charles Praplan <charprap>

 

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

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by pantxo (Posted a comment)
  • -email is unavailable- added by rik5 (Posted a comment)
  • -email is unavailable- added by charprap (Submitted the item)
  •  

    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 7 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2018-10-25 pantxo StatusConfirmed Fixed
        Open/ClosedOpen Closed
    2018-04-14 rik5 CategoryPlotting Plotting with OpenGL
        Priority5 - Normal 3 - Low
        Item GroupNone Incorrect Result
        StatusNone Confirmed
        Summaryxlabel, hold &amp; plot fcts Order of plot commands xlabel, hold & plot fcts

    Back to the top

    Powered by Savane 3.13-f8d8.
    Corresponding source code