[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 13:15:21 CET 2016


Hello,

> De : users [mailto:users-bounces at lists.scilab.org] De la part de christophk
> Envoyé : lundi 14 novembre 2016 12:06
>
> I want to have a certain control over the plot limits as I might autocreate a lot of similar plots
> and want to force the same axis limits to all for comparability.
> In this example, I am not satisfied with the odd axis ticks see attached example.
> Zero should alway be a tick if it is within the axis intervals

OK, it is a bit clearer now.

I don't know exactly what you consider as a nice labelling.

For me, it would be to have only decimal number i.e. the last number displayed increases by one at each tick.

Is it something like this?

So, I try to understand your procedure.

All this of course depends on the size of the picture (in millimeters or inches or pixels),
but we can assume that you also want to always have the same picture size.

So, the general solution might be to set the number of ticks you want, say "about" 10.
This is probably your step1 (or step inside the function) variable.

You first determine the order of magnitude of the last number that should be displayed,
this is the stepmagnitude variable.

You multiply the min and max value to work with integers with the "*10^power" operation.
For the sake of understanding, let me rename your variables:
xmin and xmax still have their original values, then define

----------

xminint = floor(xmin*10^power);

xmaxint = ceil(xmin*10^power);

----------

I wonder if the following tick position

10e(-power)*(xminint:xmaxint);

would be satisfying.
If you have negative and positive values,
then zero would be in this vector (because it is an integer between the extrema).

Would this simple solution fit your needs?

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