Problems in octave 5.1.0 in the function plot

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

Problems in octave 5.1.0 in the function plot

arkkimede
Hi!
Few days ago I found the instruction for the installation of Octave 5.1.0 on ubuntu 18.04.
Now I'm octave running on my linux box Ubuntu 18.04.
But I have a problem.
Considering this minimal code:
%--------start
#!/usr/bin/octave -qf

D2R = pi/180.;

ang_d=0:1:360;
ang_r=ang_d*D2R;

h=figure;

plot(ang_d, sin(ang_r));

refresh;

waitfor(h)
%--------stop

If I plot the sine function the line is interrupted.

The same if I use the octave GUI how reported in this screenshot:

Please could you help me?

PS: I used octave 5.1.0 in Windows and this issu does not present
PS2 I tried also changing graphics_toolkit without results



Reply | Threaded
Open this post in threaded view
|

Re: Problems in octave 5.1.0 in the function plot

Dmitri A. Sergatskov
On Thu, May 30, 2019 at 11:03 AM arkkimede <[hidden email]> wrote:

>
> Hi!
> Few days ago I found the instruction for the installation of Octave 5.1.0 on ubuntu 18.04.
> This link report the instructions that I'v used: https://www.math.univ-paris13.fr/~cuvelier/Octave/Ubuntu_18-04LTS.html#x37-75000.9.1
> Now I'm octave running on my linux box Ubuntu 18.04.
> But I have a problem.
> Considering this minimal code:
> %--------start
>
> #!/usr/bin/octave -qf
>
> D2R = pi/180.;
>
> ang_d=0:1:360;
> ang_r=ang_d*D2R;
>
> h=figure;
>
> plot(ang_d, sin(ang_r));
>
> refresh;
>
> waitfor(h)
>
> %--------stop
>
> If I plot the sine function the line is interrupted.
>
> The same if I use the octave GUI how reported in this screenshot:
> https://imagizer.imageshack.com/img921/6600/oCseaa.png
>
> Please could you help me?
>
> PS: I used octave 5.1.0 in Windows and this issu does not present
> PS2 I tried also changing graphics_toolkit without results
>
>

I am pretty sure this is the problem with your graphics card opengl driver.
If you are using mesa (i.e. no the proprietary nvidia driver) try to set
LIBGL_ALWAYS_SOFTWARE =1 before starting octave.

Regards,
Dmitri.
--


Reply | Threaded
Open this post in threaded view
|

Re: Problems in octave 5.1.0 in the function plot

arkkimede
Thanks Dmitri you catch the problem.
Putting in the .bashrc the line
export LIBGL_ALWAYS_SOFTWARE=1
the plot now is regular an correct.
Thanks again.

Il giorno gio 30 mag 2019 alle ore 19:39 Dmitri A. Sergatskov <[hidden email]> ha scritto:
On Thu, May 30, 2019 at 11:03 AM arkkimede <[hidden email]> wrote:
>
> Hi!
> Few days ago I found the instruction for the installation of Octave 5.1.0 on ubuntu 18.04.
> This link report the instructions that I'v used: https://www.math.univ-paris13.fr/~cuvelier/Octave/Ubuntu_18-04LTS.html#x37-75000.9.1
> Now I'm octave running on my linux box Ubuntu 18.04.
> But I have a problem.
> Considering this minimal code:
> %--------start
>
> #!/usr/bin/octave -qf
>
> D2R = pi/180.;
>
> ang_d=0:1:360;
> ang_r=ang_d*D2R;
>
> h=figure;
>
> plot(ang_d, sin(ang_r));
>
> refresh;
>
> waitfor(h)
>
> %--------stop
>
> If I plot the sine function the line is interrupted.
>
> The same if I use the octave GUI how reported in this screenshot:
> https://imagizer.imageshack.com/img921/6600/oCseaa.png
>
> Please could you help me?
>
> PS: I used octave 5.1.0 in Windows and this issu does not present
> PS2 I tried also changing graphics_toolkit without results
>
>

I am pretty sure this is the problem with your graphics card opengl driver.
If you are using mesa (i.e. no the proprietary nvidia driver) try to set
LIBGL_ALWAYS_SOFTWARE =1 before starting octave.

Regards,
Dmitri.
--


Reply | Threaded
Open this post in threaded view
|

Re: Problems in octave 5.1.0 in the function plot

arkkimede
In reply to this post by Dmitri A. Sergatskov
Dear Dimitri,
if your setting seams to solve the problem in 2D (the function sin is plotted in continuous way, there are in any case some problems in 3D.
You can see an example of a conical cat in the pictures a these links:
You can see that the red lines stops in the meddle of the picture, also rotating theĀ  the axes.
In any case thank you for your support.
Best regards.

Il giorno gio 30 mag 2019 alle ore 19:39 Dmitri A. Sergatskov <[hidden email]> ha scritto:
On Thu, May 30, 2019 at 11:03 AM arkkimede <[hidden email]> wrote:
>
> Hi!
> Few days ago I found the instruction for the installation of Octave 5.1.0 on ubuntu 18.04.
> This link report the instructions that I'v used: https://www.math.univ-paris13.fr/~cuvelier/Octave/Ubuntu_18-04LTS.html#x37-75000.9.1
> Now I'm octave running on my linux box Ubuntu 18.04.
> But I have a problem.
> Considering this minimal code:
> %--------start
>
> #!/usr/bin/octave -qf
>
> D2R = pi/180.;
>
> ang_d=0:1:360;
> ang_r=ang_d*D2R;
>
> h=figure;
>
> plot(ang_d, sin(ang_r));
>
> refresh;
>
> waitfor(h)
>
> %--------stop
>
> If I plot the sine function the line is interrupted.
>
> The same if I use the octave GUI how reported in this screenshot:
> https://imagizer.imageshack.com/img921/6600/oCseaa.png
>
> Please could you help me?
>
> PS: I used octave 5.1.0 in Windows and this issu does not present
> PS2 I tried also changing graphics_toolkit without results
>
>

I am pretty sure this is the problem with your graphics card opengl driver.
If you are using mesa (i.e. no the proprietary nvidia driver) try to set
LIBGL_ALWAYS_SOFTWARE =1 before starting octave.

Regards,
Dmitri.
--


Reply | Threaded
Open this post in threaded view
|

Re: Problems in octave 5.1.0 in the function plot

Dmitri A. Sergatskov
On Fri, May 31, 2019 at 1:09 AM arkkimede <[hidden email]> wrote:
>
> Dear Dimitri,
> if your setting seams to solve the problem in 2D (the function sin is plotted in continuous way, there are in any case some problems in 3D.
> You can see an example of a conical cat in the pictures a these links:
> https://ibb.co/TvGVGqJ
> https://ibb.co/7Gf4X86
> You can see that the red lines stops in the meddle of the picture, also rotating the  the axes.
> In any case thank you for your support.
> Best regards.

To get a meaningful response you need to post a self-contained code
that demonstrate the problem.

Regards,

Dmitri.
--


Reply | Threaded
Open this post in threaded view
|

Re: Problems in octave 5.1.0 in the function plot

arkkimede
This is the minimum code that on
Ubuntu 18.04
Octave 5.1.0
produces the error: if you rotate the picture, you will see only half red curve:

%============== start script
function conical_cut
D2R = pi/180.;
R2D = 180./pi;

downTilt_d = 30;
downTild_r = downTilt_d * D2R;

% -------------------------------------------------
% Equation that describe the cut with theta costant
% -------------------------------------------------
phi_d = 0:0.01:360;
phi_r = phi_d * D2R;
x = cos(downTild_r) * cos(phi_r);
y = cos(downTild_r) * sin(phi_r);
z = zeros(size(x)) - sin(downTild_r);

h = figure;

% ------------
% Plot the cut
% ------------
plot3(x,y,z,'r');
hold on;
axis off;
axis equal;

% -------------
% Plot the axis
% -------------
plot3([-1 1],[0 0],[0 0],'k');
text([1.2],[0.2],[0],'x','fontsize',20);

plot3([0 0],[-1 1],[0 0],'k');
text([0],[1.1],[0],'y','fontsize',20);

plot3([0 0],[0 0],[0 1],'k');
text([0],[0],[1.1],'z','fontsize',20);


%============= end script

Thank you


Il giorno ven 31 mag 2019 alle ore 14:41 Dmitri A. Sergatskov <[hidden email]> ha scritto:

To get a meaningful response you need to post a self-contained code
that demonstrate the problem.

Regards,

Dmitri.
--


Reply | Threaded
Open this post in threaded view
|

Re: Problems in octave 5.1.0 in the function plot

Dmitri A. Sergatskov
On Fri, May 31, 2019 at 8:26 AM arkkimede <[hidden email]> wrote:

>
> This is the minimum code that on
> Ubuntu 18.04
> Octave 5.1.0
> produces the error: if you rotate the picture, you will see only half red curve:
>
> %============== start script
> function conical_cut
> D2R = pi/180.;
> R2D = 180./pi;
>
> downTilt_d = 30;
> downTild_r = downTilt_d * D2R;
>
> % -------------------------------------------------
> % Equation that describe the cut with theta costant
> % -------------------------------------------------
> phi_d = 0:0.01:360;
> phi_r = phi_d * D2R;
> x = cos(downTild_r) * cos(phi_r);
> y = cos(downTild_r) * sin(phi_r);
> z = zeros(size(x)) - sin(downTild_r);
>
> h = figure;
>
> % ------------
> % Plot the cut
> % ------------
> plot3(x,y,z,'r');
> hold on;
> axis off;
> axis equal;
>
> % -------------
> % Plot the axis
> % -------------
> plot3([-1 1],[0 0],[0 0],'k');
> text([1.2],[0.2],[0],'x','fontsize',20);
>
> plot3([0 0],[-1 1],[0 0],'k');
> text([0],[1.1],[0],'y','fontsize',20);
>
> plot3([0 0],[0 0],[0 1],'k');
> text([0],[0],[1.1],'z','fontsize',20);
>
>
> %============= end script
>
> Thank you
>
>
This is what i got with octave 6.0. Not sure if this is what you are expecting.

Dmitri.
--



t1.png (27K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Problems in octave 5.1.0 in the function plot

arkkimede
Yes, the picture that you report is exactly what I want to see.
What I see (on my Ubuntu 18.04 and Octave 5.1.0), if you imagine the picture divided in 2 equal parts, left one and right one,is the red curve only in the left one and nothing in the right one.
Also, if you change view, always the left part visible. When you realize a "top view" the curve reappear.
BR

Il giorno ven 31 mag 2019 alle ore 15:39 Dmitri A. Sergatskov <[hidden email]> ha scritto:
On Fri, May 31, 2019 at 8:26 AM arkkimede <[hidden email]> wrote:
>
> This is the minimum code that on
> Ubuntu 18.04
> Octave 5.1.0
> produces the error: if you rotate the picture, you will see only half red curve:
>
> %============== start script
> function conical_cut
> D2R = pi/180.;
> R2D = 180./pi;
>
> downTilt_d = 30;
> downTild_r = downTilt_d * D2R;
>
> % -------------------------------------------------
> % Equation that describe the cut with theta costant
> % -------------------------------------------------
> phi_d = 0:0.01:360;
> phi_r = phi_d * D2R;
> x = cos(downTild_r) * cos(phi_r);
> y = cos(downTild_r) * sin(phi_r);
> z = zeros(size(x)) - sin(downTild_r);
>
> h = figure;
>
> % ------------
> % Plot the cut
> % ------------
> plot3(x,y,z,'r');
> hold on;
> axis off;
> axis equal;
>
> % -------------
> % Plot the axis
> % -------------
> plot3([-1 1],[0 0],[0 0],'k');
> text([1.2],[0.2],[0],'x','fontsize',20);
>
> plot3([0 0],[-1 1],[0 0],'k');
> text([0],[1.1],[0],'y','fontsize',20);
>
> plot3([0 0],[0 0],[0 1],'k');
> text([0],[0],[1.1],'z','fontsize',20);
>
>
> %============= end script
>
> Thank you
>
>

This is what i got with octave 6.0. Not sure if this is what you are expecting.

Dmitri.
--


Reply | Threaded
Open this post in threaded view
|

Re: Problems in octave 5.1.0 in the function plot

Dmitri A. Sergatskov
OK. I found a computer where I can reproduce this problem.
With hardware acceleration line is fully drawn but looks un-even, with
software renderer, the line is smooth, but only 1/2 a circle is drawn.
(this is with a recent octave 6.0 snapshot acedcba362be tip @).

It looks to me this is an OpenGL problem, not sure if octave can
do something to mitigate it. May be somebody else can comment.

Dmitri.
--



soft.png (31K) Download Attachment
hard.png (31K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Problems in octave 5.1.0 in the function plot

arkkimede
Hi!

The conclusion is: "At the moment avoid to use Octave 5.1.0" waiting for a new release that solve the issue?
Do you agree with me?

Il giorno ven 31 mag 2019 alle ore 19:49 Dmitri A. Sergatskov <[hidden email]> ha scritto:
OK. I found a computer where I can reproduce this problem.
With hardware acceleration line is fully drawn but looks un-even, with
software renderer, the line is smooth, but only 1/2 a circle is drawn.
(this is with a recent octave 6.0 snapshot acedcba362be tip @).

It looks to me this is an OpenGL problem, not sure if octave can
do something to mitigate it. May be somebody else can comment.

Dmitri.
--


Reply | Threaded
Open this post in threaded view
|

Re: Problems in octave 5.1.0 in the function plot

Dmitri A. Sergatskov
On Mon, Jun 3, 2019 at 1:55 AM arkkimede <[hidden email]> wrote:
>
> Hi!
>
> The conclusion is: "At the moment avoid to use Octave 5.1.0" waiting for a new release that solve the issue?
> Do you agree with me?
>

The problem appears to be with OpenGL driver, rather than with Octave.
I can reproduce the
problem with Octave 6.0 (current development version).
You can try gnuplot backend for now (you can set "graphics_toolkit
gnuplot" in .octaverc e.g.)

Dmitri.
--


Reply | Threaded
Open this post in threaded view
|

Re: Problems in octave 5.1.0 in the function plot

nrjank
On Mon, Jun 3, 2019 at 9:04 AM Dmitri A. Sergatskov
<[hidden email]> wrote:

>
> On Mon, Jun 3, 2019 at 1:55 AM arkkimede <[hidden email]> wrote:
> >
> > Hi!
> >
> > The conclusion is: "At the moment avoid to use Octave 5.1.0" waiting for a new release that solve the issue?
> > Do you agree with me?
> >
>
> The problem appears to be with OpenGL driver, rather than with Octave.
> I can reproduce the
> problem with Octave 6.0 (current development version).
> You can try gnuplot backend for now (you can set "graphics_toolkit
> gnuplot" in .octaverc e.g.)
>
> Dmitri.
> --
>
>

I hadn't followed this conversation because I saw it mentioned it was
a Linux graphics issue, and then you mentioned it was a driver issue.
Out of curiosity I ran the conical_cut script on my Windows 10 machine
with Octave 5.1.0 and switched graphics_toolkits. With qt and fltk I
get the half circle, with gnuplot I get the full circle. I don't have
access to enable/disable hardware acceleration to see if it's an
issue. So if it's an OpenGL driver issue it's cross-platform.


Reply | Threaded
Open this post in threaded view
|

Re: Problems in octave 5.1.0 in the function plot

Dmitri A. Sergatskov
On Mon, Jun 3, 2019 at 10:28 AM Nicholas Jankowski <[hidden email]> wrote:

>
> I hadn't followed this conversation because I saw it mentioned it was
> a Linux graphics issue, and then you mentioned it was a driver issue.
> Out of curiosity I ran the conical_cut script on my Windows 10 machine
> with Octave 5.1.0 and switched graphics_toolkits. With qt and fltk I
> get the half circle, with gnuplot I get the full circle. I don't have
> access to enable/disable hardware acceleration to see if it's an
> issue. So if it's an OpenGL driver issue it's cross-platform.

The problem appears to be with the current mesa llvmpipe driver.

Dmitri.
--