Re: plot discrete spectrum
- To: mathgroup at smc.vnet.net
- Subject: [mg23509] Re: plot discrete spectrum
- From: "John M. Jowett" <John.Jowett at cern.ch>
- Date: Tue, 16 May 2000 02:44:56 -0400 (EDT)
- Organization: CERN
- References: <8eg6vb$hdm@smc.vnet.net> <8ekvbd$q98@smc.vnet.net> <lv2Q4.16$5j.710@ralph.vnet.net> <8fn46o$a0d@smc.vnet.net>
- Sender: owner-wri-mathgroup at wolfram.com
"John M. Jowett" wrote: > Hello, > I put this together in a little package after seeing the earlier > postings. The auot-saved package file is quoted below. I'll send the Sorry everyone, I forgot an important Needs[ ..] line in the package. Here is is again John Jowett (*-------------------------------------------------------------------*) BeginPackage["MathMethods`SpectralPlot`"] SpectralPlot::usage = "SpectralPlot.m is a package that provides functions for plotting spectra." SpectralListPlot::usage = "SpectralListPlot[data] works exactly like ListPlot except that each point is joined to the horizontal axis by a line and the PlotJoined option is ignored." SpectralPlot::badarg = "You called `1` with argument `2`!" Begin["`Private`"] Needs["Utilities`FilterOptions`"] Options[SpectralListPlot]=Select[Options[ListPlot],First[#1]=!=PlotJoined&] SpectralListPlot[data_,opts___?OptionQ]:=Module[{pl,df}, df=DisplayFunction/.{opts}/.Options[SpectralListPlot]; pl=ListPlot[data,PlotJoined\[Rule]False, Evaluate[FilterOptions[ListPlot,opts]], DisplayFunction\[Rule]Identity]/.Point[{x_,y_}]\[RuleDelayed] Line[{{x,y},{x,0}}]; Show[pl,DisplayFunction\[Rule]df,Evaluate[FilterOptions[Graphics,opts]], Evaluate[FilterOptions[Graphics,Options[SpectralListPlot]]]] ] End[ ] EndPackage[ ] (*-------------------------------------------------------------------*)