The current legend class does not support multiple columns.
Eric Wertman once mentioned in this list that he would work on this
feature, but I don't know the current status.
A (partial) rewrite of the legend class which I plan to support
multicolumns is in my TODO list but I haven't started it yet.

Meanwhile, you may try to make multiple legends as a posible workarounds.
For example, following code plots 10 lines and make two legends, each
with 5 lines, one at upper left and one at upper right.


ax = gca()
pl_list = []
for i in range(10):
    pl, = ax.plot(random(10))
    pl_list.append(pl)

from matplotlib.legend import Legend
l1 = Legend(ax, pl_list[:5], "01234", loc=2)
l2 = Legend(ax, pl_list[5:], "56789", loc=1)
#l1 = Legend(ax, pl_list[:5], "01234", loc=(0.02, 0.72))
#l2 = Legend(ax, pl_list[5:], "56789", loc=(0.2, 0.72))

ax.add_artist(l1)
ax.add_artist(l2)

draw()


You may manually adjust the legend position to place the legends side
by side (see the commented lines), but it would be somewhat tricky if
you need 4 columns.

-JJ






On Thu, Oct 9, 2008 at 10:50 AM, José Alexandre Nalon
<[EMAIL PROTECTED]> wrote:
> Hello,
>
> Is there an easy way to make a legend with multiple lines
> and columns? I need 8 plots in the same figure, and the
> legend takes a lot of space. I believe that if I could
> orient the legend in multiple lines and columns (say, 2
> lines with four columns each), I could save a lot of
> space, giving more room to the plots. Any other suggestion
> would be useful. Thanks in advance.
>
> --
> José Alexandre Nalon
> [EMAIL PROTECTED]
>
> -------------------------------------------------------------------------
> This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
> Build the coolest Linux based applications with Moblin SDK & win great prizes
> Grand prize is a trip for two to an Open Source event anywhere in the world
> http://moblin-contest.org/redirect.php?banner_id=100&url=/
> _______________________________________________
> Matplotlib-users mailing list
> Matplotlib-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Reply via email to