bugGNU Octave - Bugs: bug #45504, incompatibile interaction subplot...

 
 

bug #45504: incompatibile interaction subplot & axes

Submitter:  None
Submitted:  Thu 09 Jul 2015 05:42:37 PM UTC
   
 
Category:  Plotting Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Incorrect Result
Status:  Invalid / Not an Octave Bug Assigned to:  None
Originator Name:  Clinton Winant Originator Email:  -email is unavailable-
Open/Closed:  * Closed Release:  * 3.8.1
Operating System:  * GNU/Linux Fixed Release:  None
Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Wed 13 Dec 2017 05:25:37 PM UTC, comment #3: 

This isn't how the subplot command works.  The subplot command creates axes on an existing figure.  If you want to reposition the subplots you should change the "position" property of the individual axes.  In this case, if you are really trying to create 4 different plots then you need to use


hax1 = subplot (4,1,1);
hax2 = subplot (4,1,2);
hax3 = subplot (4,1,3);
hax4 = subplot (4,1,4);

set (hax1, "position", [ ... ]);
set (hax2, "position", [ ... ]);
set (hax3, "position", [ ... ]);
set (hax4, "position", [ ... ]);

plot(hax1, [0 1],[0 1],'k','linewidth',1);
plot(hax2, [0 1],[1 0],'k--','linewidth',1);
plot(hax3, [0 1],[0 1],'k','linewidth',1);
plot(hax4, [0 1],[1 0],'k--','linewidth',1);


Closing report.

Rik <rik5>
Group administrator
Thu 29 Dec 2016 10:13:01 PM UTC, comment #2: 

This behavior is still present in Octave 4.2.0.

The plot produced by the script in comment #0 still ignores the axis("position") command. Only two subplots are displayed in the final figure window.

This issue also appears with graphics_toolkit qt, not only with gnuplot. The bug report tags should be corrected accordingly.

Hartmut <hardy>
Fri 10 Jul 2015 05:43:39 AM UTC, comment #1: 

Is this gnuplot only?  Qt graphics toolkit seems to behave the same way.  In both cases, entering

axes('position',[0.04,0.05,0.45,0.45]);

after the plots are drawn adds an axes in the lower left corner.  In fact, if one watches closely, they'll see the smaller axes drawn first and then the typical subplot format/dimensions on top of that.  What is your assessment?

In addition, I would point out that the gnuplot toolkit appears to not recognize the dash pattern.  However, I may have fixed that as part of this changeset

https://savannah.gnu.org/bugs/?34523

where I used gnuplot's recently added "dashtype" option for linestyles.

Dan Sebald <sebald>
Thu 09 Jul 2015 05:42:37 PM UTC, original submission:  

Using subplot within a frame defined by (axes('Position',[...]) leads to ignoring the axes command, as shown in the following code


clf
for kplot=1:2
if kplot==1
   axes('position',[0.04,0.05,0.45,0.45]);
subplot(2,1,1)
plot([0 1],[0 1],'k','linewidth',1);
subplot(2,1,2)
plot([0 1],[1 0],'k--','linewidth',1);
else
   axes('position',[0.54,0.05,0.45,0.45]);
subplot(2,1,1)
plot([0 1],[1 0],'k','linewidth',1);
subplot(2,1,2)
plot([0 1],[0 1],'k--','linewidth',1);
endif
end

commenting out the subplot calls restores the axes call.

Anonymous

 

(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 rik5 (Posted a comment)
  • -email is unavailable- added by hardy (Posted a comment)
  • -email is unavailable- added by sebald (Posted a comment)
  • -email is unavailable- added by None (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 3 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2017-12-13 rik5 CategoryPlotting with gnuplot Plotting
        StatusNone Invalid / Not an Octave Bug
        Open/ClosedOpen Closed

    Back to the top

    Powered by Savane 3.13-aa77.
    Corresponding source code