[scilab-Users] graphic axis tic label with two lines

Antoine Monmayrant antoine.monmayrant at laas.fr
Wed Sep 1 22:27:13 CEST 2010


Jens Wunderlich a écrit :
>  Hi all,
>
> is it possible to have the tics of let's say the x-axis labelled with 
> a two-lines string?
> In my case I like to have labels with date and time. These labels are 
> too long and are printed overlapping. To avoid this it would be nice 
> to have the time below the date.
>
> I tried:
>
> //working example with all in one line
> ha=gca();
>
> ha.x_ticks.labels(1) = '2010-09-01 20:55';
>
> //this doesn't work
> ha.x_ticks.labels(2) = ['2010-09-01' '20:55' ]
>
> Any help would be appreciated.
>
> Thanks,
> Jens
You can try this latex horror:

x=[1:10];
y=sin(x);
h=scf();
plot(x,y);
a=gca();
a.x_ticks.labels(5)="$ \begin{matrix}\text{First line}\\ \text{Second 
line}\end{matrix} $";

But I think there is also a package you can use to rotate the ticks to 
avoid overlapping.

Antoine



More information about the users mailing list