Re: [Scilab-users] plotplots() in Scilab

2021-04-02 Thread Samuel Gougeon

Le 02/04/2021 à 11:19, Clément David a écrit :

../..

 2. I found the need to have a second axe (example 1) different to
recompute ticks (example 2). I might have miss something, could
you clarify these two usage ?


I am afraid to not understand your query. Could you elaborate, please?


___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] plotplots() in Scilab

2021-04-02 Thread Samuel Gougeon

Dear all,

Thanks for your first feedbacks. I am somewhat answering in the body of 
this message:


Le 02/04/2021 à 14:49, Antoine Monmayrant a écrit :

On 02/04/2021 12:16, CRETE Denis wrote:


Hello,

I am also in favour of including this function in Scilab, with an 
“improved” name. However, as far as I know, an inset has very 
frequently its own pair of axes, as opposed to a ticks-switching in 
(only one of) the axes. Thus, I would not recommend a name with 
“inset” and reserve it for a function more closely implementing an inset.


Zoom is quite appealing.

I was wondering about “non-linear”_something…


Hello Denis,

I'm with you here: this should be included, but the name is not well 
matching the features of the function.

Indeed, 'inset' is not at all what 'plot_plot' is offering.
I was also thinking about "non-linear-axis" or something like that, 
but I am not sure such a name will improve discoverability of the 
function.

But you are right: this is about having non-regular or non-linear axis.

nonlinear-plot ? non-regular-plot ? All this is not convincing for me...

You know, i thought very hard about the plotplots() naming before 
finding and choosing this one and first publishing it ;-))


Indeed, plotplots() is not at all about insets, although an actually 
zooming inset plotting separate function could also be useful (with the 
zooming box and possibly rays linking it to the inset).


plotplots() is *not* about zooming or non-linear axis either: it can be 
used with different and only linear scales, without mixing log and lin ones.
So why "plotplots"? Typing "plot" in /Google Translate/ (from english to 
french), i've got and we still get:


So *"plots" is very frequently used with the meanings "parcels, pieces, 
patches, particles, shreds"*.
To me, this is just the right one, close to what the function actually 
addresses: plotting several parcels/pieces/patches of some given graphics.
This led me to this compact -- and i think talkative and meaningful -- 
plotplots() name, that's not (only) a word game.


Other names i thought about were with "multiscaled", or thinks like 
"plot_multiscale". But to me, this could lead to some confusion with 
multiple axes covering the same whole graphic, as documented @ 
https://help.scilab.org/docs/6.1.0/en_US/plot_multiscaled.html.


That's (almost) the whole story about this plotplots() name.
Is it more meaningful to you?

Samuel


___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] Int3D / Triple integration

2021-04-02 Thread Stéphane Mottelet

They are the number of the vertices of the cube, as generated by ndgrid:

--> [(1:8)' x(:) y(:) z(:)]
 ans  =

   1.   0.   0.   0.
   2.   1.   0.   0.
   3.   0.   1.   0.
   4.   1.   1.   0.
   5.   0.   0.   1.
   6.   1.   0.   1.
   7.   0.   1.   1.
   8.   1.   1.   1.

S.

Le 02/04/2021 à 15:49, arctica1963 a écrit :

Quick query re: your code,

How is the index (i) defined?
i = [5 8 2 3
  5 8 2 6
  5 8 3 7
  5 2 3 1
  2 3 8 4]';

Just trying to fully understand your method.

Lester



--
Sent from: 
https://antispam.utc.fr/proxy/1/c3RlcGhhbmUubW90dGVsZXRAdXRjLmZy/mailinglists.scilab.org/Scilab-users-Mailing-Lists-Archives-f2602246.html
___
users mailing list
users@lists.scilab.org
https://antispam.utc.fr/proxy/1/c3RlcGhhbmUubW90dGVsZXRAdXRjLmZy/lists.scilab.org/mailman/listinfo/users


--
Stéphane Mottelet
Ingénieur de recherche
EA 4297 Transformations Intégrées de la Matière Renouvelable
Département Génie des Procédés Industriels
Sorbonne Universités - Université de Technologie de Compiègne
CS 60319, 60203 Compiègne cedex
Tel : +33(0)344234688
http://www.utc.fr/~mottelet

___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] Int3D / Triple integration

2021-04-02 Thread arctica1963
Quick query re: your code,

How is the index (i) defined?
i = [5 8 2 3
 5 8 2 6
 5 8 3 7
 5 2 3 1
 2 3 8 4]';

Just trying to fully understand your method.

Lester



--
Sent from: 
http://mailinglists.scilab.org/Scilab-users-Mailing-Lists-Archives-f2602246.html
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] plotplots() in Scilab

2021-04-02 Thread Clément David
Hello Samuel, hello all,

First thanks for the request for inclusion, that’s always good to have more 
features into Scilab itself. However, I have a few remarks regarding this 
function.


  1.  The function name plotplots() does not seem well known nor easy to find ; 
after a few research I found similar behavior for Matlab and Matplotlib worded 
as “zoomed” or “zoomed_inset_axes” which better represent the behavior.

  *   
https://stackoverflow.com/questions/13583153/how-to-zoomed-a-portion-of-image-and-insert-in-the-same-plot-in-matplotlib
  *   https://fr.mathworks.com/matlabcentral/fileexchange/59857-zoomplot
  *   
https://fr.mathworks.com/matlabcentral/answers/349042-zoomed-plot-in-the-same-figure

What about using `plot_zoomed()`, `plot_inset()` or `plot_inside()` ?


  1.  I found the need to have a second axe (example 1) different to recompute 
ticks (example 2). I might have miss something, could you clarify these two 
usage ?

Thanks,

Clément


From: users  On Behalf Of Samuel Gougeon
Sent: Thursday, April 1, 2021 10:07 PM
To: International users mailing list for Scilab. 
Subject: [Scilab-users] plotplots() in Scilab


Dear all,
I would like to propose to include the plotplots() graphical function into 
Scilab.

For now 3 years, plotplots() is distributed alone in its own external 
module, with a fair number of 
downloads for a single function.

Its embedded documentation is as well provided online as PDF, in 
english
 and in 
french.

As soon as a function has a local singularity or/and an asymptotical behavior 
(that's quite common), plotplots() is very helpful to illustrate its specific 
behaviors without masking more "regular" features with a crushing graphical 
scale.

Every comment is welcome about the current plotplots status, and about the 
proposal to include it as a native Scilab function.

Hope reading you,

Best regards

Samuel
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] Int3D / Triple integration

2021-04-02 Thread arctica1963
Hi Stephane,

Thanks for the information and methodology, useful to know. Learn something
new all the time with Scilab!

Kind regards

Lester



--
Sent from: 
http://mailinglists.scilab.org/Scilab-users-Mailing-Lists-Archives-f2602246.html
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] plotplots() in Scilab

2021-04-02 Thread Antoine Monmayrant


On 02/04/2021 12:16, CRETE Denis wrote:


Hello,

I am also in favour of including this function in Scilab, with an 
“improved” name. However, as far as I know, an inset has very 
frequently its own pair of axes, as opposed to a ticks-switching in 
(only one of) the axes. Thus, I would not recommend a name with 
“inset” and reserve it for a function more closely implementing an inset.


Zoom is quite appealing.

I was wondering about “non-linear”_something…


Hello Denis,

I'm with you here: this should be included, but the name is not well 
matching the features of the function.

Indeed, 'inset' is not at all what 'plot_plot' is offering.
I was also thinking about "non-linear-axis" or something like that, but 
I am not sure such a name will improve discoverability of the function.

But you are right: this is about having non-regular or non-linear axis.

nonlinear-plot ? non-regular-plot ? All this is not convincing for me...

By the way, we have developed some ugly hacks in the past to get 
'non-linear' or 'non-regular' colormaps for the same reason than Samuel.
The idea was to rescale the data to Sgrayplot such that one could map 
exact intermediate Z_values to some colors of existing or new colormap:


[0, 0.1, 1, 2, 100] -> [black, red, orange, yellow, white]

One of the key advantage is that you could be sure that a certain value 
(like z=0) was exactly corresponding to a certain color (like white) 
which is sometime necessary (for plotting  asymmetric waves or fields 
with a red-white-blue colormap for example).


Antoine


Thank you for your developments

Denis

*De :*users  *De la part de* Clément David
*Envoyé :* vendredi 2 avril 2021 11:20
*À :* sgoug...@free.fr; Users mailing list for Scilab 


*Objet :* Re: [Scilab-users] plotplots() in Scilab

Hello Samuel, hello all,

First thanks for the request for inclusion, that’s always good to have 
more features into Scilab itself. However, I have a few remarks 
regarding this function.


1.The function name plotplots() does not seem well known nor easy to 
find ; after a few research I found similar behavior for Matlab and 
Matplotlib worded as “zoomed” or “zoomed_inset_axes” which better 
represent the behavior.


·https://stackoverflow.com/questions/13583153/how-to-zoomed-a-portion-of-image-and-insert-in-the-same-plot-in-matplotlib

·https://fr.mathworks.com/matlabcentral/fileexchange/59857-zoomplot

·https://fr.mathworks.com/matlabcentral/answers/349042-zoomed-plot-in-the-same-figure

What about using `plot_zoomed()`, `plot_inset()` or `plot_inside()` ?

2.I found the need to have a second axe (example 1) different to 
recompute ticks (example 2). I might have miss something, could you 
clarify these two usage ?


Thanks,

Clément

*From:*users > *On Behalf Of *Samuel Gougeon

*Sent:* Thursday, April 1, 2021 10:07 PM
*To:* International users mailing list for Scilab. 
mailto:users@lists.scilab.org>>

*Subject:* [Scilab-users] plotplots() in Scilab

Dear all,

I would like to propose to include the plotplots() graphical function 
into Scilab.


For now 3 years, plotplots() is distributed alone in its own external 
module , with a fair 
number of downloads for a single function.


Its embedded documentation is as well provided online as PDF, in 
english 
and 
in french 
.


As soon as a function has a local singularity or/and an asymptotical 
behavior (that's quite common), plotplots() is very helpful to 
illustrate its specific behaviors without masking more "regular" 
features with a crushing graphical scale.


Every comment is welcome about the current plotplots status, and about 
the proposal to include it as a native Scilab function.



Hope reading you,

Best regards

Samuel


___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] Int3D / Triple integration

2021-04-02 Thread Stéphane Mottelet


Le 02/04/2021 à 12:53, arctica1963 a écrit :

Hi Stephane,

At the moment I am just trying to understand how Scilab works with triple
integration of f(x,y,z) with limits for xyz.


Ok, when you say "limits" for xyz you mean that each variable varies in 
a given constant interval, that's what I meant by the rectangular 
parallelepiped [x1,x2] x [y1,y2] x [z1,z2]. In fact it is a pity that 
Scilab does not handle this case but only the more general case of a 
collection of (eventually disconnected) tetrahedrons. However, cutting 
your parallepiped in 5 (https://www.geogebra.org/m/C3TjXxFY)  is enough 
to use int3d, since they will be recursively divided to attain the 
required precision:


deff('v=f(xyz,numfun)','v=xyz(1)^2+xyz(2)^2+xyz(3)^2')
xlim=[0  1];
ylim=[0  1];
zlim=[0  1];
[x,y,z]=ndgrid(xlim,ylim,zlim);
i  =  [5  8  2  3
 5  8  2  6
 5  8  3  7
 5  2  3  1
 2  3  8  4]';
[result,err]  =  int3d(x(i),y(i),z(i),f) --> result result = 1.000 --> err err = 
1.110D-14


S.


Lester



--
Sent from: 
https://antispam.utc.fr/proxy/1/c3RlcGhhbmUubW90dGVsZXRAdXRjLmZy/mailinglists.scilab.org/Scilab-users-Mailing-Lists-Archives-f2602246.html
___
users mailing list
users@lists.scilab.org
https://antispam.utc.fr/proxy/1/c3RlcGhhbmUubW90dGVsZXRAdXRjLmZy/lists.scilab.org/mailman/listinfo/users


--
Stéphane Mottelet
Ingénieur de recherche
EA 4297 Transformations Intégrées de la Matière Renouvelable
Département Génie des Procédés Industriels
Sorbonne Universités - Université de Technologie de Compiègne
CS 60319, 60203 Compiègne cedex
Tel : +33(0)344234688
http://www.utc.fr/~mottelet

___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] Int3D / Triple integration

2021-04-02 Thread arctica1963
Hi Stephane,

At the moment I am just trying to understand how Scilab works with triple
integration of f(x,y,z) with limits for xyz. 

Lester



--
Sent from: 
http://mailinglists.scilab.org/Scilab-users-Mailing-Lists-Archives-f2602246.html
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] plotplots() in Scilab

2021-04-02 Thread CRETE Denis
Hello,

I am also in favour of including this function in Scilab, with an “improved” 
name. However, as far as I know, an inset has very frequently its own pair of 
axes, as opposed to a ticks-switching in (only one of) the axes. Thus, I would 
not recommend a name with “inset” and reserve it for a function more closely 
implementing an inset.
Zoom is quite appealing.
I was wondering about “non-linear”_something…

Thank you for your developments
Denis

De : users  De la part de Clément David
Envoyé : vendredi 2 avril 2021 11:20
À : sgoug...@free.fr; Users mailing list for Scilab 
Objet : Re: [Scilab-users] plotplots() in Scilab

Hello Samuel, hello all,

First thanks for the request for inclusion, that’s always good to have more 
features into Scilab itself. However, I have a few remarks regarding this 
function.

1.   The function name plotplots() does not seem well known nor easy to 
find ; after a few research I found similar behavior for Matlab and Matplotlib 
worded as “zoomed” or “zoomed_inset_axes” which better represent the behavior.
·   
https://stackoverflow.com/questions/13583153/how-to-zoomed-a-portion-of-image-and-insert-in-the-same-plot-in-matplotlib
·   https://fr.mathworks.com/matlabcentral/fileexchange/59857-zoomplot
·   
https://fr.mathworks.com/matlabcentral/answers/349042-zoomed-plot-in-the-same-figure

What about using `plot_zoomed()`, `plot_inset()` or `plot_inside()` ?

2.   I found the need to have a second axe (example 1) different to 
recompute ticks (example 2). I might have miss something, could you clarify 
these two usage ?

Thanks,

Clément


From: users 
mailto:users-boun...@lists.scilab.org>> On 
Behalf Of Samuel Gougeon
Sent: Thursday, April 1, 2021 10:07 PM
To: International users mailing list for Scilab. 
mailto:users@lists.scilab.org>>
Subject: [Scilab-users] plotplots() in Scilab


Dear all,
I would like to propose to include the plotplots() graphical function into 
Scilab.

For now 3 years, plotplots() is distributed alone in its own external 
module, with a fair number of 
downloads for a single function.

Its embedded documentation is as well provided online as PDF, in 
english
 and in 
french.

As soon as a function has a local singularity or/and an asymptotical behavior 
(that's quite common), plotplots() is very helpful to illustrate its specific 
behaviors without masking more "regular" features with a crushing graphical 
scale.

Every comment is welcome about the current plotplots status, and about the 
proposal to include it as a native Scilab function.

Hope reading you,

Best regards

Samuel
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] Int3D / Triple integration

2021-04-02 Thread Stéphane Mottelet

Hi Lester,

If I understand well, you are only interested by integrating on

[x1,x2] x [y1,y2] x [z1,z2]

and not a general volume, that's it ?

S.

Le 02/04/2021 à 11:53, arctica1963 a écrit :

Hello all,

An update on a solution. Following e-mail correspondence with a fellow
Scilab user (Javier Domingo), he has worked out a general solution to
vectorising the X,Y,Z arrays for the tetrahedrons required by int3d. So
taking this part of the code and adding a call to int3d within a function we
get a simpler route to doing triple integrals given a function (f) and lower
and upper limits of integration defined by x1,x2,y1,y2,z1,z2:

function [Integral, Error] = Integral_3d (f, x1, x2, y1, y2, z1, z2)
// Divide prism (given by abscissa: x1, x2, ordinate: y1 to y2 and z1 to z2)
into
// 12 tetrahedra (not regular), starting from the center of the prism, cover
all its volume;
// providing the array IX (abscissa of the vertices of the triangles),
// and the array IY (ordinate of the vertices of the triangles).
xc = (x1 + x2) / 2; yc = (y1 + y2) / 2; zc = (z1 + z2) / 2; // center of
prism
// coordinates of the prism tips (2 prisms on each face)
// bottom -top- right -left- front -rear-
LX = [xc, xc, xc, xc, xc, xc, xc, xc, xc, xc, xc, xc;
x1, x1, x1, x1, x2, x2, x1, x1, x1, x1, x1, x1;
x2, x1, x2, x1, x2, x2, x1, x1, x2, x1, x2, x1;
x2, x2, x2, x2, x2, x2, x1, x1, x2, x2, x2, x2];
LY = [yc, yc, yc, yc, yc, yc, yc, yc, yc, yc, yc, yc;
y1, y1, y1, y1, y1, y2, y1, y2, y1, y1, y2, y2;
y1, y2, y1, y2, y2, y2, y2, y2, y1, y1, y2, y2;
y2, y2, y2, y2, y1, y1, y1, y1, y1, y1, y2, y2];
LZ = [zc, zc, zc, zc, zc, zc, zc, zc, zc, zc, zc, zc;
z1, z1, z2, z2, z1, z2, z1, z2, z1, z1, z1, z1;
z1, z1, z2, z2, z1, z1, z1, z1, z1, z2, z1, z2;
z1, z1, z2, z2, z2, z2, z2, z2, z2, z2, z2, z2];

[Integral, Error] = int3d (LX, LY, LZ, f, 1, [0,10,1.d-5,1.d-7]);


endfunction

As a simple test one can define a function v=x^2 + y^2 + z^2 with limits of
0 to 1 - which simplifies to 1.0 as the sum of the iterated integrals.

deff('v=f(xyz,numfun)','v=xyz(1)^2+xyz(2)^2+xyz(3)^2')
x1=0;x2=1;y1=0;y2=1;z1=0;z2=1;

--> [Integral, Error] = Integral_3d (f, x1, x2, y1, y2, z1, z2)
  Integral  =

1.
  Error  =

1.110D-14

Thanks to Javier for his work on defining/clarifying the X,Y,Z arrays and
logic for defining the equation in Scilab. As a suggestion it would seem
reasonable to have this aspect either built into the function (int3d) or for
a separate mesh3d function to build tetrahedrons in a format compatible with
int3d.

Always great to exchange ideas to formulate a solution to a problem.

Code tested under Scilab version 6.1.0

Lester




--
Sent from: 
https://antispam.utc.fr/proxy/1/c3RlcGhhbmUubW90dGVsZXRAdXRjLmZy/mailinglists.scilab.org/Scilab-users-Mailing-Lists-Archives-f2602246.html
___
users mailing list
users@lists.scilab.org
https://antispam.utc.fr/proxy/1/c3RlcGhhbmUubW90dGVsZXRAdXRjLmZy/lists.scilab.org/mailman/listinfo/users


--
Stéphane Mottelet
Ingénieur de recherche
EA 4297 Transformations Intégrées de la Matière Renouvelable
Département Génie des Procédés Industriels
Sorbonne Universités - Université de Technologie de Compiègne
CS 60319, 60203 Compiègne cedex
Tel : +33(0)344234688
http://www.utc.fr/~mottelet

___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] Int3D / Triple integration

2021-04-02 Thread arctica1963
Hello all,

An update on a solution. Following e-mail correspondence with a fellow
Scilab user (Javier Domingo), he has worked out a general solution to
vectorising the X,Y,Z arrays for the tetrahedrons required by int3d. So
taking this part of the code and adding a call to int3d within a function we
get a simpler route to doing triple integrals given a function (f) and lower
and upper limits of integration defined by x1,x2,y1,y2,z1,z2:

function [Integral, Error] = Integral_3d (f, x1, x2, y1, y2, z1, z2)
// Divide prism (given by abscissa: x1, x2, ordinate: y1 to y2 and z1 to z2)
into
// 12 tetrahedra (not regular), starting from the center of the prism, cover
all its volume;
// providing the array IX (abscissa of the vertices of the triangles),
// and the array IY (ordinate of the vertices of the triangles).
   xc = (x1 + x2) / 2; yc = (y1 + y2) / 2; zc = (z1 + z2) / 2; // center of
prism
// coordinates of the prism tips (2 prisms on each face)
// bottom -top- right -left- front -rear-
   LX = [xc, xc, xc, xc, xc, xc, xc, xc, xc, xc, xc, xc;
   x1, x1, x1, x1, x2, x2, x1, x1, x1, x1, x1, x1;
   x2, x1, x2, x1, x2, x2, x1, x1, x2, x1, x2, x1;
   x2, x2, x2, x2, x2, x2, x1, x1, x2, x2, x2, x2];
   LY = [yc, yc, yc, yc, yc, yc, yc, yc, yc, yc, yc, yc;
   y1, y1, y1, y1, y1, y2, y1, y2, y1, y1, y2, y2;
   y1, y2, y1, y2, y2, y2, y2, y2, y1, y1, y2, y2;
   y2, y2, y2, y2, y1, y1, y1, y1, y1, y1, y2, y2];
   LZ = [zc, zc, zc, zc, zc, zc, zc, zc, zc, zc, zc, zc;
   z1, z1, z2, z2, z1, z2, z1, z2, z1, z1, z1, z1;
   z1, z1, z2, z2, z1, z1, z1, z1, z1, z2, z1, z2;
   z1, z1, z2, z2, z2, z2, z2, z2, z2, z2, z2, z2];
   
[Integral, Error] = int3d (LX, LY, LZ, f, 1, [0,10,1.d-5,1.d-7]);

endfunction

As a simple test one can define a function v=x^2 + y^2 + z^2 with limits of
0 to 1 - which simplifies to 1.0 as the sum of the iterated integrals.

deff('v=f(xyz,numfun)','v=xyz(1)^2+xyz(2)^2+xyz(3)^2')
x1=0;x2=1;y1=0;y2=1;z1=0;z2=1;

--> [Integral, Error] = Integral_3d (f, x1, x2, y1, y2, z1, z2)
 Integral  = 

   1.
 Error  = 

   1.110D-14

Thanks to Javier for his work on defining/clarifying the X,Y,Z arrays and
logic for defining the equation in Scilab. As a suggestion it would seem
reasonable to have this aspect either built into the function (int3d) or for
a separate mesh3d function to build tetrahedrons in a format compatible with
int3d.

Always great to exchange ideas to formulate a solution to a problem.

Code tested under Scilab version 6.1.0

Lester




--
Sent from: 
http://mailinglists.scilab.org/Scilab-users-Mailing-Lists-Archives-f2602246.html
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users