MathGroup Archive 2007

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

Search the Archive

Slow Manipulate with image argument

  • To: mathgroup at smc.vnet.net
  • Subject: [mg79200] Slow Manipulate with image argument
  • From: "Maarten van der Burgt" <maarten.vanderburgt at icos.be>
  • Date: Fri, 20 Jul 2007 04:07:11 -0400 (EDT)

Dear all,





Consider the lines of code below:



dat =Table[Sin[x y/2],{x,-10,10,0.04},{y,-10,10,0.04}];

gr=ArrayPlot[dat];

h=Length[dat];
w =Length[dat[[1]]];

Manipulate[
GraphicsColumn[{Show[{gr,Graphics[{Green,Line
[{{0,h-i},{w,h-i}}]}]}],ListPlot[dat[[i]],PlotJoined->True,PlotRange->
{-1,1}]}],
{{i,200},1,h,1}]


In the code above I generate a quite large array with data (= dat; in my
real application dat is an image of similar size which I want to analyze).


I generate an ArrayPlot (gr) of the data.


Using Manipulate I want to show the data in each line of the array using
ListPlot.


It would help the analysis if in the same Manipulate window I could show
the image with a line drawn on top of it, indicating which line of the
array is shown in the ListPlot.


This all works, but, since the graphics needs to be updated every time,
Manipulate becomes very slow.


Has anyone a bright idea how to speed this up, or to write this slightly
different with the same (but faster) result?


Thanks for your help,


Maarten















  • Prev by Date: Using .m files instead of .nb files in workbench
  • Next by Date: Re: strange bug?
  • Previous by thread: Using .m files instead of .nb files in workbench
  • Next by thread: Re: Slow Manipulate with image argument