bugGNU Octave - Bugs: bug #41937, plotyy with hold on is missing an...


bug #41937: plotyy with hold on is missing an output

Submitted by:  None
Submitted on:  Sun 23 Mar 2014 12:24:48 AM UTC  
Category:  Plotting Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Incorrect Result
Status:  Fixed Assigned to:  None
Originator Name:  Gerrit Barrere Originator Email:  -email is unavailable-
Open/Closed:  Closed Release:  3.8.1
Operating System:  Microsoft Windows

Add a New Comment (Rich Markup)

You are not logged in

Please log in, so followups can be emailed to you.


Mon 24 Mar 2014 01:44:25 AM UTC, comment #5: 

Perfect - thank you!

Gerrit Barrere <gerritb>
Sun 23 Mar 2014 09:36:43 PM UTC, comment #4: 

The Mercurial repository is available through a web interface at http://hg.savannah.gnu.org/hgweb/octave/file/5032ac119d52/scripts/plot/draw/plotyy.m

Hit the "Raw File" button to actually download it.

Rik <rik5>
Project Administrator
Sun 23 Mar 2014 09:24:59 PM UTC, comment #3: 

Hmm, I can't find the source for this after a half hour or so of looking.  I'm just an Octave user, and not a very sophisticated one at that.  Would you send a link?  Thank you!

Gerrit Barrere <gerritb>
Sun 23 Mar 2014 08:53:28 PM UTC, comment #2: 

Thanks, Rik. I'll find plotyy.m in the development sources and use that until 4.2 hits the streets.

Sun 23 Mar 2014 06:40:34 PM UTC, comment #1: 

Happily this problem has been fixed, but it has been fixed on the development branch of Octave that is schedule for the 4.2 release (a long time from now).  Either you can build from source, or since this is just an m-file, you can copy the file plotyy.m from the development sources and replace your local version with the newer one.

Rik <rik5>
Project Administrator
Sun 23 Mar 2014 12:24:48 AM UTC, original submission:  

When I superimpose two plotyy's using 'hold on' the first y2 plot doesn't display.  This is an example:

clear all;
N = 200;

hold on;
xa  = linspace (0, 10, N);
y1a = sin (2*pi*xa/10 - .0*pi);
y2a = sin (2*pi*xa/10 - .1*pi);
[ax, h1, h2] = plotyy (xa, y1a, xa, y2a);
set (h1, 'color', 'r');
set (h2, 'color', 'g');

xb  = linspace (0, 10, N);
y1b = sin (2*pi*xb/10 - .2*pi);
y2b = sin (2*pi*xb/10 - .3*pi);
[ax, h1, h2] = plotyy (xb, y1b, xb, y2b);
set (h1, 'color', 'b');
set (h2, 'color', 'k');

There should be four sine waves separated by pi/10 in phase, but the second one (y2a, which should be green) is missing.

I also see this problem when importing data for the various vectors x and y.

I've tried different N for the two plotyy's with the same result.

I've tried simple plotyy calls with no handle returns or 'set' calls with the same result.

I'm not specifying a graphics toolkit, so I think this means I'm using OpenGL?

Thanks for any help,



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

Attach Files:

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 gerritb (Posted a comment)
  • -email is unavailable- added by rik5 (Posted a comment)
  • -email is unavailable- added by None (Submitted the item)

    Do you think this task is very important?
    If so, you can add your encouragement to it.
    This task has 0 encouragements so far.

    Only project members can vote.




    Follow 2 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2014-03-23 rik5 StatusNone => Fixed
        Open/ClosedOpen => Closed

    Back to the top

    Powered by Savane 3.5