Color and legend for stem() and stairs()
David Bateman
David.Bateman at motorola.com
Tue Oct 21 04:48:13 CDT 2008
Christoph Dalitz wrote:
> Hallo,
>
> eventually I have figured out that the culprit is the stem() function.
> Whenever stem() is called, subsequent calls to legend() no longer work
> properly.
>
> Shall I file a bug report? (If yes: where can bugs be submitted?)
>
> As a workaround, I have noticed that legends given subsequently to
> plot() commands (with the ";...;" argument) actually are not messed up.
>
> So the following works:
>
> stem(x,y);
> legend("y(x)");
> [xs,zs] = stairs(x,z);
> plot(xs,zs,";z(x);"); # legends drawn with the plot are not messed up
>
> But not:
>
> stem(x,y);
> [xs,zs] = stairs(x,z);
> legend("y(x)","z(x)"); # previous call to stem makes all legends identical
>
>
Don't bother with the bug report... We're aware of the issue in 3.0.x is
that the stem plot in fact creates multiple handles rather than a single
hggroup as Matlab does. Work is underway to fix this in 3.1.51+ and
though the legend issue is not yet fully addressed the stem plot is now
an hggroup. For now the workaround in 3.0.x is to do something like
close all; x=y=z=1:10; h1 = stem(x,y); hold on; stairs(x,z);
legend("y(x)", "", "", "z(x)")
where there are two null legend entries to compensate for the additional
unused handles..
D.
--
David Bateman David.Bateman at motorola.com
Motorola Labs - Paris +33 1 69 35 48 04 (Ph)
Parc Les Algorithmes, Commune de St Aubin +33 6 72 01 06 33 (Mob)
91193 Gif-Sur-Yvette FRANCE +33 1 69 35 77 01 (Fax)
The information contained in this communication has been classified as:
[x] General Business Information
[ ] Motorola Internal Use Only
[ ] Motorola Confidential Proprietary
More information about the Help-octave
mailing list