« Return to Thread: patch for plotyy.m

patch for plotyy.m

by Eric Chassande-Mottin :: Rate this Message:

Reply to Author | View in Thread


plotyy.m is not robust. an error occurs depending
on figure with axes is already opened or not.
here is a patch that should solve the problem.

*** old/plotyy.m 2009-06-12 13:25:50.000000000 +0200
--- new/plotyy.m 2009-06-12 13:25:11.000000000 +0200
***************
*** 72,82 ****
      endif
    else
      f = get (0, "currentfigure");
!     if (isempty (f))
        ax(1) = axes ();
        ax(2) = axes ();
      else
-       ax = get (f, "children");
        for i = 3 : length (ax)
  delete (ax (i));
        endfor
--- 72,85 ----
      endif
    else
      f = get (0, "currentfigure");
!     if isempty(f)
!       figure;
!     endif
!     ax = get (f, "children");
!     if length(ax) < 2
        ax(1) = axes ();
        ax(2) = axes ();
      else
        for i = 3 : length (ax)
  delete (ax (i));
        endfor

 « Return to Thread: patch for plotyy.m