[Scilab-users] {EXT} Re: finding reasonable axis markers for plotting a random data set

Dang Ngoc Chan, Christophe Christophe.Dang at sidel.com
Mon Nov 14 10:37:58 CET 2016


Hello again,

> Nov 10, 2016; 8:58pm
> christophk
> Any feedback on how improve it or replace it with existing Scilab features are more than welcome.
> testcode.sci <http://mailinglists.scilab.org/file/n4034958/testcode.sci>

As I understand it, you want to do what Scilab automatically does,
because for some reason you're not fully satisfied with the automatic scale.

You might also tell us the reason why you're not satisfied,
so we can advise you or fill in a wishlist for the next version.

Nevertheless, to answer to your call for comments:

You should first explain the way you proceed.
We have to understand your algorithm by reading the code and the comments, which is quite painful.

And I do not have that time,  so here are just some minor comments.

Concerning the first function, which aim is apparently to find the order of magnitude of a variable,
you might use the logarithm function.

You can have the order of magnitude with

order_of_magnitude =  floor(log10(abs(stepmagnitude)))

then process it; in your case, if I understand well your function, it would be something like

power = 0;
if order_of_magnitude < 0 then power = - order_of_magnitude;
end

which is a bit astonishing.
I wonder if you considered the case where the X value is greater than 1,
I think that simply power = - order_of_magnitude (without testing the sign) would be more relevant.

So, from what I understand, you want to extract the significand.

The test

if xmin<0 & xmax>0

might be replaced by

if (xmin*xmax) < 0

Hope this helps,

regards

--
Christophe Dang Ngoc Chan
Mechanical calculation engineer
This e-mail may contain confidential and/or privileged information. If you are not the intended recipient (or have received this e-mail in error), please notify the sender immediately and destroy this e-mail. Any unauthorized copying, disclosure or distribution of the material in this e-mail is strictly forbidden.



More information about the users mailing list