Mathematica 9 is now available
Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
2000
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*November
*December
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2000

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

Search the Archive

Re: plot discrete spectrum

  • To: mathgroup at smc.vnet.net
  • Subject: [mg23293] Re: [mg23266] plot discrete spectrum
  • From: Bojan Bistrovic <bojanb at python.physics.odu.edu>
  • Date: Sun, 30 Apr 2000 21:13:43 -0400 (EDT)
  • Sender: owner-wri-mathgroup at wolfram.com

> 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 math.umass.edu
> Mathematics & Statistics Dept.       phone 413 549-1020 (H)
> Univ. of Massachusetts                     413 545-2859 (W)
> Amherst, MA 01003-4515
> 
This one looks nice :-)

<<Graphics`Graphics`

ListPlot2[args_List, opts___]:=
  Show@@Block[{$DisplayFunction=Identity},{ListPlot[args,opts],
        BarChart[Map[{#[[2]],#[[1]]}&,args],BarGroupSpacing->1]}]

For energy spectrums you can make it even nicer by experimenting with
different BarChart options.

Bye, Bojan

--
---------------------------------------------------------------------
Bojan Bistrovic,                                      bojanb at jlab.org
Old Dominion University, Norfolk VA & Jefferson Lab, Newport News, VA
---------------------------------------------------------------------


  • Prev by Date: Re: ISING model
  • Next by Date: Re: hating DSolve...
  • Previous by thread: RE: plot discrete spectrum
  • Next by thread: Problem with Plot and Ticks-function