Re: Slow Manipulate with image argument
- To: mathgroup at smc.vnet.net
- Subject: [mg79217] Re: Slow Manipulate with image argument
- From: Albert <awnl at arcor.net>
- Date: Sat, 21 Jul 2007 04:28:18 -0400 (EDT)
- References: <f7pqi0$1a8$1@smc.vnet.net>
hi Maarten,
this looks better than my first try, the code as well as result :-).
Still for some reasons there is a little offset between the line and the
underlying picture which I could not resolve...
dat = Table[Sin[x y/2], {x, -10, 10, 0.04}, {y, -10, 10, 0.04}];
gr = ArrayPlot[dat, PlotRangePadding -> 0, ImagePadding -> 0];
h = Length[dat];
w = Length[dat[[1]]];
With[{h = h},
Manipulate[GraphicsRow[{
Graphics[{
Inset[gr, {1, h}, {1, h}, h],
Green, AbsoluteThickness[4],
Dynamic[Line[{{0, h - i}, {h, h - i}}]]},
PlotRange -> {{1, h}, {1, h}}, ImageSize -> 400
],
Dynamic[ListPlot[dat[[i]],
Joined -> True, PlotRange -> {-1, 1}, ImageSize -> 400]]
}], {{i, Floor[h/2]}, 1, h, 1}
]
]
hth,
(a row was more appropriate than a column on my wide-screen laptop...)
albert