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

Rafael Guerra jrafaelbguerra at hotmail.com
Sat Feb 23 16:47:14 CET 2013


Hello,

 

One alternative to your solution which can hide a lot of the plotted data if
the legend names are big:



 

is to keep the legends as short as possible by using only numbers and
placing the full text of the curve legends on the figure's title:

 



 

 

Does someone know how to further reduce the width of the legend box above
(which would be better set to half of its size)?

 

It would be important to have in plot2d the option to post the legends
completely outside the plotting area. Could we achieve this by using
subplots for instance?

 

PS:

Some of the limitations of the plot legends can be found in bugzilla bug
tracker, for instance "bug" number: 7906.

 

 

Best regards,

Rafael Guerra

 

 

From: users-bounces at lists.scilab.org [mailto:users-bounces at lists.scilab.org]
On Behalf Of Samuel Gougeon
Sent: Saturday, February 23, 2013 10:11 AM
To: International users mailing list for Scilab.
Subject: Re: [Scilab-users] Format legends of a graph as a 2D table

 

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"<
 /span><
span style="color:rgb(74,85,219);">);
    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/8eab355a/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image003.png
Type: image/png
Size: 8375 bytes
Desc: not available
URL: <https://lists.scilab.org/pipermail/users/attachments/20130223/8eab355a/attachment.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image002.jpg
Type: image/jpeg
Size: 69864 bytes
Desc: not available
URL: <https://lists.scilab.org/pipermail/users/attachments/20130223/8eab355a/attachment.jpg>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image006.jpg
Type: image/jpeg
Size: 85703 bytes
Desc: not available
URL: <https://lists.scilab.org/pipermail/users/attachments/20130223/8eab355a/attachment-0001.jpg>


More information about the users mailing list