MathGroup Archive 1996

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

Search the Archive

Re: Q:Nicer than: Function[x,MapAt[Im,x,2]]/@data


rommel at bc.edu wrote:
> 
> I want to ListPlot the imaginary part of data:
> 
> data={{x0,z0},{x1,z1},{x2,z2}}
> 
> The x? are real, the z? complex.
> 
> My simple but ugly solution was
> 
> Transpose[{Transpose[data][[1]],Im[Transpose[data][[2]]]}]
> 
> after reading a little I came to the shorter
> 
> Function[x,MapAt[Im,x,2]]/@data
> 
> Is there a nicer way to do it?


Use rule-based programming:

-- 


  • Prev by Date: Re: Q:Nicer than: Function[x,MapAt[Im,x,2]]/@data
  • Next by Date: Re: Q:Nicer than: Function[x,MapAt[Im,x,2]]/@data
  • Previous by thread: Re: Q:Nicer than: Function[x,MapAt[Im,x,2]]/@data
  • Next by thread: Re: Q:Nicer than: Function[x,MapAt[Im,x,2]]/@data