setting color and alpha channel of histograms

Crystal! But then the legends second example(legend_demo2)

    > is a bit misleading since it uses the syntax I used
    > originally (without the subscripts). I am aware of the
    > difference between the two situations, but my general
    > point is that since the examples are one of the main
    > sources of instruction for users, they should be as
    > complete as possible, i.e. contain as many variations on
    > the theme as possible, don't you agree? Of course they
    > should not substitute the prime directive: RTFM!, but they
    > are a powerful tool that should be explored.

Well, in this case it would be RTNYEFM (RT not-yet-existant FM) so I
would hesitate to advise it. Yes, the difference in your example and
the one in is that in the latter the sequence of lines
returned by plot are length 1 whereas in hist they are longer. The
legend code "flattens" the list of lines/patches and so consumes the
sequences in order until the list of labels is exhausted. In your
original example, the patches from the first hist used up all your

I changed to read

l1, = plot(t2, exp(-t2))
l2, l3 = plot(t2, sin(2*pi*t2), '--go', t1, log(1+t1), '.')
l4, = plot(t2, exp(-t2)*sin(2*pi*t2), 'rs-.')

legend( (l2, l4), ('oscillatory', 'damped'), 'upper right')

Adding the commas after l1 and l4 unpack the sequence returned by
plot, so l1 and l4 are now Line2D instances, not a sequence of lines.

This whole business of return values being objects or sequences of
objects is obscured by the fact that 'set' will operate on either,
which is true for matlab, BTW.