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

Rafael Guerra jrafaelbguerra at hotmail.com
Wed Feb 27 01:43:20 CET 2013


Hello Samuel,

 

Thanks for the very useful tip about the plot margins and for the elaborated
legends_multicolumn function.

 

I think it is important  to be able to place the plot legends automatically
and to have the option but not be obliged to do it manually.

 

For instance, the example below was generated automatically using the legend
command and allowing for some extra margin at the top of the plot area: 

ax.margins(3)=0.3;   // upper margin

legend(names_legend, -5);  // upper caption

 

cid:image002.jpg at 01CE1469.28AD9830

 

The legends were chopped off but I think that with all the insight you
provided, we can adapt your "legends_mc" function in order to create a
sister "legend_mc" function; automated using the "legend" command, the width
of the legend blocks and the plot margins property,  so that we do not need
to manually position the legends outside the plots.

 

Thanks and regards,

Rafael G.

 

From: users-bounces at lists.scilab.org [mailto:users-bounces at lists.scilab.org]
On Behalf Of Samuel Gougeon
Sent: Monday, February 25, 2013 3:15 PM
To: International users mailing list for Scilab.
Subject: Re: [Scilab-users] Format legends of a graph as a 2D table

 

Hello Rafael,

Le 23/02/2013 16:47, Rafael Guerra a écrit :

Hello,

 

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

(figure)

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:
(figure)

Yes, it's a nice solution.

.../...

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?

it is not really the job of plot2d() to put legends, despite its leg=..
parameter.
legends() (and legends_multicolumn() on fileexchange) allow to place
the bloc of legends anywhere on the figure, without any clipping out of the
data_bounds of the active axes.
Yes, using subplot() can be helpful, or more simply increasing by hand the 
chosen margin of the axes where to put the legends:
clf, plot2d()
ax = gca(); ax.margins(2)=0.3;

cid:image003.png at 01CE1465.D6E77AF0

Regards
Samuel

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.scilab.org/pipermail/users/attachments/20130226/503c93d1/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image003.png
Type: image/png
Size: 13268 bytes
Desc: not available
URL: <https://lists.scilab.org/pipermail/users/attachments/20130226/503c93d1/attachment.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image002.jpg
Type: image/jpeg
Size: 42376 bytes
Desc: not available
URL: <https://lists.scilab.org/pipermail/users/attachments/20130226/503c93d1/attachment.jpg>


More information about the users mailing list