Re: stem function of Matlab?
- To: mathgroup at christensen.cybernetics.net
- Subject: [mg462] Re: [mg454] stem function of Matlab?
- From: bakshee (Igor Bakshee)
- Date: Mon, 13 Feb 1995 10:09:02 -0600
>I want to use a function like 'stem' function in Matlab to plot discrete
>
>sequence data.
>
It is easy to construct such a function:
dropLine[{x_,y_}] := Line[{x,#}& /@ {0,y}];
DiscretePlot[args__] := Block[{$DisplayFunction = Identity},
ListPlot[args, PlotJoined->False] /.
Point[point_] :> {Point[point],dropLine[point]}
] //Show
Example:
DiscretePlot[Range[10]-5,PlotStyle->PointSize[.02]]
Of course you may use other options just like in ListPlot.
Igor Bakshee
bakshee at wri.com
Applications Development
Wolfram Research, Inc.