legend orientation

Hi all, I have some minor problems with legend, but I

    > don't find how to figure out: - if the figure contains
    > only one plot, the text orientation of the legend is
    > vertical. How can I change this? - when plots are in '-'
    > style without markers, the lines are not shown in the
    > legend, I just have text. thanks -- Lionel Roubeyrie -
    > lroubeyrie@...1068... LIMAIR http://www.limair.asso.fr

Make sure you pass in a list of strings, and not a single string. If
you have just a single string, it interprets it as a list of
characters.

JDH

  s = 'mylabel'
  line, = plot(something)
  legend([line], [s])

Note the comma in "line, = plot(something)" which performs tuple
unpacking of a list of lines. plot returns a list of lines, so you
could also do

  lines = plot(something)
  legend(lines, [s])

but not

  lines = plot(something)
  legend(lines, s)

because then you have a list of lines and a sequence of characters.

JDH

Yes, I have seen my error too late, thanks.
But I can't get a line in the legend, just markers?

···

Le mardi 26 septembre 2006 14:22, John Hunter a écrit :

Make sure you pass in a list of strings, and not a single string. If
you have just a single string, it interprets it as a list of
characters.

JDH

--
Lionel Roubeyrie - lroubeyrie@...1068...
LIMAIR
http://www.limair.asso.fr