MathGroup Archive 1995

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: stem function of Matlab?


>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.




  • Prev by Date: Just Published: The Mathematica Graphics Guidebook
  • Next by Date: Play function and mathematica
  • Previous by thread: stem function of Matlab?
  • Next by thread: Re: Re: stem function of Matlab?