MathGroup Archive 2000

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

Search the Archive

RE: plot discrete spectrum

  • To: mathgroup at
  • Subject: [mg23295] RE: [mg23266] plot discrete spectrum
  • From: "David Park" <djmp at>
  • Date: Sun, 30 Apr 2000 21:13:45 -0400 (EDT)
  • Sender: owner-wri-mathgroup at

> Is there an easy way to do a ListPlot[{{{x1, y1}, {x2, y2}, ..., {xn,
> yn}} in which each a perpendicular is dropped from each dot to the
> horizontal axis?
> Of course, when can combine the ListPlot with a Graphics object
> consisting of line segments.  I prefer a way that avoids using graphics
> primitives directly.
> The sort of plot I want is what's usually done to display, for example,
> the energy spectrum of a Fourier series.
> --
> Murray Eisenberg                     murray at
> Mathematics & Statistics Dept.       phone 413 549-1020 (H)
> Univ. of Massachusetts                     413 545-2859 (W)
> Amherst, MA 01003-4515


I don't think it is possible to do away with the use of graphic primitives,
but we can hide them.

data = Table[{x, Sin[x]}, {x, 0, 2*Pi, 2*Pi/20}];

SpectrumPlot[data_, (opts___)?OptionQ] :=
  Show[Graphics[{data /. {(x_)?NumericQ,
        (y_)?NumericQ} -> Line[{{x, 0}, {x, y}}]}], opts]

SpectrumPlot[data, Axes -> True];

David Park
djmp at

  • Prev by Date: Re: DSolve, it should be beautiful...
  • Next by Date: Re: ISING model
  • Previous by thread: Re: plot discrete spectrum
  • Next by thread: Re: plot discrete spectrum