[Scilab-users] Ticks labels in form of number above number

Samuel Gougeon sgougeon at free.fr
Thu Feb 21 17:48:16 CET 2019


Hello Izabela,

Le 21/02/2019 à 17:38, Izabela Wójcik-Grząba a écrit :
> Hello,
>
> In my plot every tick_label in the x-axis is made of two numbers (the 
> second is in the parenthesis). Now they are printed next to each other 
> like for example:
> 0.2 (11)
>
> See the code below:
>
> f_l=[0.20030479
> 0.29234647
> 0.36879976
> 0.43788566
> 0.50263554
> 0.56453135
> 0.62441298];
>
> L_0=[11:1:17]';
>
> f_l_labels=[msprintf('%3.1f\n',f_l)+' ('+string(L_0)+')'];
>
> In this form they take a lot of place along the x-axis, so I would 
> like to print the numbers one over another. I've tried different 
> options but none of them works. Particularly I was testing a Latex 
> option \atop but with no success.

You must double "\":

--> f_l_labels=[msprintf('*$*%3.1f*\\**atop*\n',f_l)+' 
('+string(L_0)+')*$*']
  f_l_labels  =
!$0.2\atop (11)$  !
!$0.3\atop (12)$  !
!$0.4\atop (13)$  !
!$0.4\atop (14)$  !
!$0.5\atop (15)$  !
!$0.6\atop (16)$  !
!$0.6\atop (17)$  !

then it should work:


Best regards
Samuel

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.scilab.org/pipermail/users/attachments/20190221/79e65c2f/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: iebencjgcaamojng.png
Type: image/png
Size: 998 bytes
Desc: not available
URL: <https://lists.scilab.org/pipermail/users/attachments/20190221/79e65c2f/attachment.png>


More information about the users mailing list