subplot errors in 5.2.0

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

subplot errors in 5.2.0

DigitalHermit
Hello all:
   (Relatively) New user to the forums here. I've been lurking and
reading and learning.

   I'm having some issues running the subplot() command in Octave
5.2.0. I am running a couple simple examples from
(https://octave.org/doc/v4.2.0/Multiple-Plots-on-One-Page.html).

On Octave 5.1.0, it works correctly. I can plot and label multiple
graphs without issue.

subplot (2, 1, 1)
fplot (@sin, [-10, 10]);
subplot (2, 1, 2)
fplot (@cos, [-10, 10]);

On 5.2.0, I am getting the following error:

>> subplot(2,1,1)
warning: division by zero
warning: called from
    subplot>subplot_position at line 337 column 15
    subplot at line 218 column 23
warning: division by zero
warning: called from
    subplot>subplot_position at line 338 column 15
    subplot at line 218 column 23
error: set: "position" must be finite
error: called from
    subplot>subplot_position at line 344 column 3
    subplot at line 218 column 23

There are some slight differences in my environment in both, which I
have tried to minimize. Both are using the same Python virtualenv
which I specify with a  "setenv PATH
/path/to/python_venv/bin:/home/kl/bin:/usr/bin" and "setenv PYTHON
python3". I have used both the 5.2.0 Snap  and Flatpak on Ubuntu/Linux
Mint and RHEL8 and they all exhibit the same issue.  Octave 5.1.0 in
these same environments are working.

Is there anyplace else I should look to troubleshoot this further?
5.2.0 is not critical at the moment, but I am in the process of moving
some Matlab scripts over and I understand it has some compatibility
improvements.

Thanks and best regards..
Kwan


Reply | Threaded
Open this post in threaded view
|

Re: subplot errors in 5.2.0

Mike Miller-4
On Fri, Feb 21, 2020 at 09:49:18 -0500, Kwan Lowe wrote:
>    (Relatively) New user to the forums here. I've been lurking and
> reading and learning.

Welcome!

>    I'm having some issues running the subplot() command in Octave
> 5.2.0. I am running a couple simple examples from
> (https://octave.org/doc/v4.2.0/Multiple-Plots-on-One-Page.html).

I can't reproduce these errors. If you look at subplot.m, these first
warnings indicate that the "position" property of your figure contains
zeros for height and width.

> >> subplot(2,1,1)
> warning: division by zero
> warning: called from
>     subplot>subplot_position at line 337 column 15
>     subplot at line 218 column 23

That doesn't happen for me, but maybe looking into why the figure height
and width are zero can help you troubleshoot further.

Cheers,

--
mike



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

Re: subplot errors in 5.2.0

DigitalHermit
On Fri, Feb 21, 2020 at 2:05 PM Mike Miller <[hidden email]> wrote:

> Welcome!

Thanks, Mike!

> I can't reproduce these errors. If you look at subplot.m, these first
> warnings indicate that the "position" property of your figure contains
> zeros for height and width.

Thank you for looking into this. I am not explicitly setting any
position parameters in my plots. Most of them are code examples that
have been running for at least a year without issue.

I did test another couple platforms. It works properly on Windows and
MacOS but fails on every Linux I've tried. This is the process I'm
using:

1. Launch Octave in GUI mode
2. Go to Command Window
3. Type the following:
   > x=linspace(-3,3)
   > subplot(2,1,1)  % This command fails immediately on Linux
   > plot(x, sin(x))

Under all the Linux versions that I've tried (Ubuntu, Mint 19.02,
CentOS) and with both the Flatpak, Snap and normal installations by
the default package repos (Apt, RPM, etc), they all fail.

I started digging through the libraries.  The subplot.m files are the
same between the 5.2.0 and 5.1.0 so I'm thinking it's something
outside of this specific library.


Reply | Threaded
Open this post in threaded view
|

Re: subplot errors in 5.2.0

Dmitri A. Sergatskov


On Fri, Feb 21, 2020 at 6:46 PM Kwan Lowe <[hidden email]> wrote:

1. Launch Octave in GUI mode
2. Go to Command Window
3. Type the following:
   > x=linspace(-3,3)
   > subplot(2,1,1)  % This command fails immediately on Linux
   > plot(x, sin(x))

Under all the Linux versions that I've tried (Ubuntu, Mint 19.02,
CentOS) and with both the Flatpak, Snap and normal installations by
the default package repos (Apt, RPM, etc), they all fail.

FWIW, this code works fine with self-compiled octave 5.2 on CentOS 8.
Most likely there is something wrong with you configurrations.
Do you share your home directory with all those systems?
Does it work in console (rather than gui)?
If you start octave as "octave -f" do you get this problem?

Dmitri.
--



Reply | Threaded
Open this post in threaded view
|

Re: subplot errors in 5.2.0

Doug Stewart-4
In reply to this post by DigitalHermit


On Fri, Feb 21, 2020 at 6:46 PM Kwan Lowe <[hidden email]> wrote:
On Fri, Feb 21, 2020 at 2:05 PM Mike Miller <[hidden email]> wrote:

> Welcome!

Thanks, Mike!

> I can't reproduce these errors. If you look at subplot.m, these first
> warnings indicate that the "position" property of your figure contains
> zeros for height and width.

Thank you for looking into this. I am not explicitly setting any
position parameters in my plots. Most of them are code examples that
have been running for at least a year without issue.

I did test another couple platforms. It works properly on Windows and
MacOS but fails on every Linux I've tried. This is the process I'm
using:

1. Launch Octave in GUI mode
2. Go to Command Window
3. Type the following:
   > x=linspace(-3,3)
   > subplot(2,1,1)  % This command fails immediately on Linux
   > plot(x, sin(x))

Under all the Linux versions that I've tried (Ubuntu, Mint 19.02,
CentOS) and with both the Flatpak, Snap and normal installations by
the default package repos (Apt, RPM, etc), they all fail.

I started digging through the libraries.  The subplot.m files are the
same between the 5.2.0 and 5.1.0 so I'm thinking it's something
outside of this specific library.



This works for me on ubuntu

--
DASCertificate for 206392



Reply | Threaded
Open this post in threaded view
|

Re: subplot errors in 5.2.0

DigitalHermit
In reply to this post by Dmitri A. Sergatskov
On Fri, Feb 21, 2020 at 7:52 PM Dmitri A. Sergatskov
<[hidden email]> wrote:
> FWIW, this code works fine with self-compiled octave 5.2 on CentOS 8.
> Most likely there is something wrong with you configurrations.

I'm thinking this is the case, but not sure what. Main difference is
that I run Python from a virtualenv.

> Do you share your home directory with all those systems?

No, all are separate. But the code is from a git repository.

> Does it work in console (rather than gui)?

Yes, console does work.

> If you start octave as "octave -f" do you get this problem?

NO!  I'm able to display the plots fine with the -f parameter added.

The contents of my .octaverc is:
cd("/home/kwan/src/octave")
setenv PYTHON python3

I've had this same octaverc for months though..  This does give me a
place to look.  Thanks so much..


Reply | Threaded
Open this post in threaded view
|

Re: subplot errors in 5.2.0

Mike Miller-4
On Fri, Feb 21, 2020 at 20:31:30 -0500, Kwan Lowe wrote:
> NO!  I'm able to display the plots fine with the -f parameter added.
>
> The contents of my .octaverc is:
> cd("/home/kwan/src/octave")
> setenv PYTHON python3

Any function files in the current directory always take precedence over
functions in the core library. So if you have for example a function or
script file named "max.m" in ~/src/octave, that will shadow the standard
"max" and possibly break other unrelated functions.

This global namespace behavior is something that typically bites people
just getting started with Octave, and my best guess is you have such a
file in your ~/src/octave.

Instead of 'cd', try 'addpath'. With 'addpath', you should get a warning
for any local functions that shadow standard functions on the load path.

If that doesn't work, try moving or renaming files one by one and
restarting Octave each time to see if one of them is the culprit.

--
mike



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

Re: subplot errors in 5.2.0

DigitalHermit
On Sat, Feb 22, 2020 at 1:49 AM Mike Miller <[hidden email]> wrote:

> Any function files in the current directory always take precedence over
> functions in the core library. So if you have for example a function or
> script file named "max.m" in ~/src/octave, that will shadow the standard
> "max" and possibly break other unrelated functions.

This makes a lot of sense. I have a hundred or so files in there now
and recently had been re-coding some finance functions. No doubt there
is some sort of collision. I was likely on a snipe hunt with 5.1.0 vs
5.2.0 as the 5.1.0 was being run from a Snap or a separate VM.

> This global namespace behavior is something that typically bites people
> just getting started with Octave, and my best guess is you have such a
> file in your ~/src/octave.
>
> Instead of 'cd', try 'addpath'. With 'addpath', you should get a warning
> for any local functions that shadow standard functions on the load path.

Thank you.. I will adjust my octaverc.

> If that doesn't work, try moving or renaming files one by one and
> restarting Octave each time to see if one of them is the culprit.

Will do this also. It's time I started being less sloppy with my
existing library of functions though, so will investigate this
further.

Thank you and everyone for your great help. I have a lot to learn.