[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Color and legend for stem() and stairs()
From: |
Christoph Dalitz |
Subject: |
Color and legend for stem() and stairs() |
Date: |
Mon, 20 Oct 2008 14:36:15 +0200 |
Hallo,
as the plot styles 'L' and '^' are apparently no longer supported
in Octave >= 2.9, I try to achieve the same with stairs() and stem().
Unlike for the plot() function, there seems however be no way to attach
a legend or a line color to a stair() or stem() plot.
I have tried the following:
hold on;
stem(x,y);
stairs(x,z);
legend("y(x)", "z(x)");
hold off;
This results in the stem plot being red, the stairs plot being blue and
the legend lines being *both* red.
I wonder whether a workaround might be to explicitly set colors for
both plots, but unlike with the plot() command, there seems to be
no way to change the color of a stem() or stairs() plot, nor is there
a way to directly attach a title (legend string) to a stairs() or stem()
plot.
Any hints are welcome,
Christoph
- Color and legend for stem() and stairs(),
Christoph Dalitz <=