[Scilab-users] Format legends of a graph as a 2D table

Samuel Gougeon sgougeon at free.fr
Sat Feb 23 14:10:42 CET 2013


Le 23/02/2013 01:54, CRETE Denis a écrit :
> .../...
> I do not understand why it is not equivalent to refer to f1.children(1)  or to refer to a1 ...
> Thank you for your help.
> Denis

The following automatically splits nL legends if blocks of Lpc lines
(if there are parasitic line-wrapping when receiving this sample,
please correct them before running it. It is ok when sending it):

clf
nL  =  40;    // number of Legends
Lpc  =  15;   // number of Lines per column
names_legend  =  "legend_"+string(1:nL);
x  =  0;     
i  =  1;
j  =  min([Lpc,  nL]);
while  i<=nL
     disp(i)
     legends(names_legend(i:j),  i:j,  font_size=3,  opt="ul");
     idL  =  gce();
     move(idL,  [x,0]);
     w  =  strange(idL.children($).data(:,1));  // width of this block
     idL.children($).line_mode  =  "off";   // masks the frame
     x  =  x+w;     // updates the position of next block
     i  =  i+Lpc;
     j  =  min([j+Lpc,  nL]);
end


Samuel




-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.scilab.org/pipermail/users/attachments/20130223/16ea7fdb/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: idcgeddh.png
Type: image/png
Size: 8375 bytes
Desc: not available
URL: <https://lists.scilab.org/pipermail/users/attachments/20130223/16ea7fdb/attachment.png>


More information about the users mailing list