MathGroup Archive 1998

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

Search the Archive

Re: ListPlot and List problem



Hi Lars,

when You read Your data You get a list

{{phi1,omega1,g1}, {phi2,omega2,g2}, ..}

You Transpose[] is nonsens because it creates a list with
{{phi1,phi2,..},{omega1,omega2,..},{g1,g2,..}}

You need

ListPlot[ myData /. {phi_?NumericQ, omega_?NumericQ, _} :> {omega,phi}]

this is fast and elegant.

If You really want to use Transpose[] You must use it twice

Transpose[
  RotateLeft[
    Drop[
      Transpose[myData], (* { phis, omegas, amps} *)
      -1
     ]  (* { phi, omegas }    *)
   ]    (* {omegas,phis}      *)
 ]      (* {{phi1,omega1},..} *)

The comments after the closing of an command describe how Your data are
looking when the command is complete.

Hope that helps
  Jens

> Hi,
> 
> I want to plot data that is stored in a file having in the format:
> 
> <frequence> <phase> <amplification>
> 
> and want to plot the BODE-Diagram. So I did:
> 
> myData = ReadList["filename",{Number, Number, Number}];
> 
> and now want a plot from <phase> over <frequence> and <amplification>
> over <frequence>I tried things like
> 
> ListPlot[Transpose[testData][[3]],PlotJoined->True]
> 
> but I always got the wrong list-format. I need
> 
> {freqence1,phase1},{freqence2, phase2}...
> 
> and I always get things like
> 
> {phase1, phase2, phase3} or so.
> 
> Can anybody help me a bit?
> 
> 
> Thanks,
> 
> Lars
> 



  • Prev by Date: Re: MathLink and Win95
  • Next by Date: Re: Active Plots
  • Prev by thread: Re: ListPlot and List problem
  • Next by thread: Re: ListPlot and List problem