Mathematica 9 is now available
Services & Resources / Wolfram Forums / MathGroup Archive
-----

MathGroup Archive 2009

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

Search the Archive

Dynamic 2D ListLinePlot PlotRange

  • To: mathgroup at smc.vnet.net
  • Subject: [mg98228] Dynamic 2D ListLinePlot PlotRange
  • From: Bryce Schober <bryce.schober at dynonavionics.com>
  • Date: Fri, 3 Apr 2009 04:35:24 -0500 (EST)

I'm a bit of a newbie here, trying to build up some data visualization
tools. I've already gotten a ListLinePlot working well with slider to adjust
xmin and xmax. I was hoping that I could set PlotRange to All for the Y axis
and it would adjust for the Y-values in the dynamically specified x range,
but no such luck. Is there some other way to not have to do the y-axis range
calculation myself?

I suppose some explanation of the dataset is desired. I have something like:
{
  {{x11,y11},{x12,y12},{x13,y13},...,{x1m,y1m}},
  {{x21,y21},{x22,y22},{x23,y23},...,{x2n,y2n}},
}
, where the x values and lengths are heterogeneous between xy lists 1 and 2

This makes the calculation of ymin and ymax very non-straightforward to me,
and re-calculation unacceptably slow on 20k+ data points per list. The
dynamic x-axis plot scaling actually goes very smoothly, by using a
construct like:

Show[
 ListLinePlot[data,PlotRange -> All,],
 PlotRange ->Dynamic[{{curxmin, curxmax},All}],
 ]

I've tried various ways to get at the problem, and the closest I've gotten
is something like:

Map[
 {Min[#], Max[#]} &,
 Map[
   (Select[
      #,
      (
        #[[1]] > tmin
         && #[[1]] < tmax
        ) &
      ]) &,
   mydata
   ][[All, All, 2]]
 ]

Which get me basically the result I want, but is really slow to evaluate,
making it undesirable as Dynamic[].

Any ideas?

-- 
Bryce Schober



  • Prev by Date: Re: Re: DeleteCases
  • Next by Date: Re: A simple ordinary differential equation
  • Previous by thread: Re: Styling the selected Tab's label in TabView
  • Next by thread: Re: Dynamic 2D ListLinePlot PlotRange