Re: bug in linkaxes ?

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Re: bug in linkaxes ?

avlas-2
I think there is a bug in linkaxes/linkprop, at least in my Octave version (flatpak package of Octave 4.3.91).

Before submitting a bug report about this, could somebody please test the following code snippet? Thanks!

        % these examples work fine
        % for ii = 1:3; ha(ii) = subplot(3,1,ii); axes(ha(ii)); plot(randn(10,1)); end
        % for ii = 1:3; ha(ii) = subplot(2,2,ii); axes(ha(ii)); plot(randn(10,1)); end
       
        % these examples do NOT work
        for ii = 1:4; ha(ii) = subplot(4,1,ii); axes(ha(ii)); plot(randn(10,1)); end
        % for ii = 1:4; ha(ii) = subplot(2,2,ii); axes(ha(ii)); plot(randn(10,1)); end
       
        linkaxes(ha, 'x')
 
This is the error I'm finding:

        error: horizontal dimensions mismatch (1x1 vs 2x1)
        error: called from
            linkprop at line 84 column 7
            linkaxes at line 83 column 13

...
a.




Reply | Threaded
Open this post in threaded view
|

Re: bug in linkaxes ?

Richard Kirk


On 27 Apr 2018, at 16:24, avlas <[hidden email]> wrote:

I think there is a bug in linkaxes/linkprop, at least in my Octave version (flatpak package of Octave 4.3.91).

Before submitting a bug report about this, could somebody please test the following code snippet? Thanks!

       % these examples work fine
       % for ii = 1:3; ha(ii) = subplot(3,1,ii); axes(ha(ii)); plot(randn(10,1)); end
       % for ii = 1:3; ha(ii) = subplot(2,2,ii); axes(ha(ii)); plot(randn(10,1)); end

       % these examples do NOT work
       for ii = 1:4; ha(ii) = subplot(4,1,ii); axes(ha(ii)); plot(randn(10,1)); end
       % for ii = 1:4; ha(ii) = subplot(2,2,ii); axes(ha(ii)); plot(randn(10,1)); end

       linkaxes(ha, 'x')

This is the error I'm finding:

       error: horizontal dimensions mismatch (1x1 vs 2x1)
       error: called from
           linkprop at line 84 column 7
           linkaxes at line 83 column 13

Seems fine on Octave, version 4.2.2 running on a Mac.
Is the linkages() call part of the test? It didn’t;t seem to do anything.

Cheers
Richard Kirk



Reply | Threaded
Open this post in threaded view
|

Re: bug in linkaxes ?

avlas-2
El divendres, 27 d’abril de 2018, a les 11:36:49 EDT, Richard Kirk va escriure:
 
  > On 27 Apr 2018, at 16:24, avlas <[hidden email]> wrote:
  >
  > I think there is a bug in linkaxes/linkprop, at least in my Octave version (flatpak package of Octave 4.3.91).
  >
  > Before submitting a bug report about this, could somebody please test the following code snippet? Thanks!
  >
  >        % these examples work fine
  >        % for ii = 1:3; ha(ii) = subplot(3,1,ii); axes(ha(ii)); plot(randn(10,1)); end
  >        % for ii = 1:3; ha(ii) = subplot(2,2,ii); axes(ha(ii)); plot(randn(10,1)); end
  >
  >        % these examples do NOT work
  >        for ii = 1:4; ha(ii) = subplot(4,1,ii); axes(ha(ii)); plot(randn(10,1)); end
  >        % for ii = 1:4; ha(ii) = subplot(2,2,ii); axes(ha(ii)); plot(randn(10,1)); end
  >
  >        linkaxes(ha, 'x')
  >
  > This is the error I'm finding:
  >
  >        error: horizontal dimensions mismatch (1x1 vs 2x1)
  >        error: called from
  >            linkprop at line 84 column 7
  >            linkaxes at line 83 column 13
 
  Seems fine on Octave, version 4.2.2 running on a Mac.
  Is the linkages() call part of the test? It didn’t;t seem to do anything.
 
  Cheers
  Richard Kirk
 
linkaxes(ha, 'x') is the crucial part of the test, which fails for me in 4.3.91 (flatpak).

It apparently does nothing because the x axis is already the same for all panels but what it does is to link them together, so a change in one panel changes all panels to be in sync.

To see that you can compare what xlim([2,9]) does if you add it before vs. after linkaxes(ha, 'x')

You should see that if you apply it before, the x axis is only changed for the active panel. In contrast if you add it after, all panels should change to [2,9]

....
a.




Reply | Threaded
Open this post in threaded view
|

Re: bug in linkaxes ?

Mike Miller-4
On Fri, Apr 27, 2018 at 11:56:40 -0400, avlas wrote:

> El divendres, 27 d’abril de 2018, a les 11:36:49 EDT, Richard Kirk va escriure:
>  
>   > On 27 Apr 2018, at 16:24, avlas <[hidden email]> wrote:
>   >
>   > I think there is a bug in linkaxes/linkprop, at least in my Octave version (flatpak package of Octave 4.3.91).
>   >
>   > Before submitting a bug report about this, could somebody please test the following code snippet? Thanks!
>   >
>   >        % these examples work fine
>   >        % for ii = 1:3; ha(ii) = subplot(3,1,ii); axes(ha(ii)); plot(randn(10,1)); end
>   >        % for ii = 1:3; ha(ii) = subplot(2,2,ii); axes(ha(ii)); plot(randn(10,1)); end
>   >
>   >        % these examples do NOT work
>   >        for ii = 1:4; ha(ii) = subplot(4,1,ii); axes(ha(ii)); plot(randn(10,1)); end
>   >        % for ii = 1:4; ha(ii) = subplot(2,2,ii); axes(ha(ii)); plot(randn(10,1)); end
>   >
>   >        linkaxes(ha, 'x')
>   >
>   > This is the error I'm finding:
>   >
>   >        error: horizontal dimensions mismatch (1x1 vs 2x1)
>   >        error: called from
>   >            linkprop at line 84 column 7
>   >            linkaxes at line 83 column 13
>  
>   Seems fine on Octave, version 4.2.2 running on a Mac.
>   Is the linkages() call part of the test? It didn’t;t seem to do anything.
>  
>   Cheers
>   Richard Kirk
>  
> linkaxes(ha, 'x') is the crucial part of the test, which fails for me in 4.3.91 (flatpak).
Yes, this looks like a regression from 4.2 to 4.4, please file a bug
report.

--
mike



signature.asc (849 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: bug in linkaxes ?

avlas-2
El divendres, 27 d’abril de 2018, a les 12:00:18 EDT, Mike Miller va escriure:

  On Fri, Apr 27, 2018 at 11:56:40 -0400, avlas wrote:
  > El divendres, 27 d’abril de 2018, a les 11:36:49 EDT, Richard Kirk va escriure:
  >  
  >   > On 27 Apr 2018, at 16:24, avlas <[hidden email]> wrote:
  >   >
  >   > I think there is a bug in linkaxes/linkprop, at least in my Octave version (flatpak package of Octave 4.3.91).
  >   >
  >   > Before submitting a bug report about this, could somebody please test the following code snippet? Thanks!
  >   >
  >   >        % these examples work fine
  >   >        % for ii = 1:3; ha(ii) = subplot(3,1,ii); axes(ha(ii)); plot(randn(10,1)); end
  >   >        % for ii = 1:3; ha(ii) = subplot(2,2,ii); axes(ha(ii)); plot(randn(10,1)); end
  >   >
  >   >        % these examples do NOT work
  >   >        for ii = 1:4; ha(ii) = subplot(4,1,ii); axes(ha(ii)); plot(randn(10,1)); end
  >   >        % for ii = 1:4; ha(ii) = subplot(2,2,ii); axes(ha(ii)); plot(randn(10,1)); end
  >   >
  >   >        linkaxes(ha, 'x')
  >   >
  >   > This is the error I'm finding:
  >   >
  >   >        error: horizontal dimensions mismatch (1x1 vs 2x1)
  >   >        error: called from
  >   >            linkprop at line 84 column 7
  >   >            linkaxes at line 83 column 13
  >  
  >   Seems fine on Octave, version 4.2.2 running on a Mac.
  >   Is the linkages() call part of the test? It didn’t;t seem to do anything.
  >  
  >   Cheers
  >   Richard Kirk
  >  
  > linkaxes(ha, 'x') is the crucial part of the test, which fails for me in 4.3.91 (flatpak).
 
  Yes, this looks like a regression from 4.2 to 4.4, please file a bug
  report.
 
Done: https://savannah.gnu.org/bugs/index.php?53767

Thanks

....
a.