MathGroup Archive 1995

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

Search the Archive

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.




  • 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?