Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Slow Locator in Manipulate

14 views
Skip to first unread message

Kevin J. McCann

unread,
May 23, 2012, 3:29:51 AM5/23/12
to
The following is a simple example of the use of a Locator on a graphic:

p1 = ContourPlot[
Sin[x y], {x, -3 \[Pi], 3 \[Pi]}, {y, -3 \[Pi], 3 \[Pi]},
ContourShading -> False];

Manipulate[
Show[p1, Graphics[{Red, AbsolutePointSize[5], Dynamic@Point[pt1]}],
PlotRange -> {{-3 \[Pi], 3 \[Pi]}, {-3 \[Pi], 3 \[Pi]}}],
{{pt1, {0, 0}}, {-3 \[Pi], -3 \[Pi]}, {3 \[Pi], 3 \[Pi]}, Locator}

]

I find that the Locator moves slowly and in a jerky fashion; however, if
I leave the underlying plot, i.e. p1, out of the Show, then it moves as
I would expect. I had thought the use of Dynamic on the Point would keep
Mathematica from constantly redrawing the graphic, but my guess is that the
slowness indicates this is not the case.

Anyone have an idea about how to make the locator move faster?

Thanks,

Kevin

E. Martín-Serrano

unread,
May 24, 2012, 3:32:35 AM5/24/12
to
Kevin,

I have reported similar problems in several occasions, with the Locator
construct, even outside Manipulate but mostly inside Dynamic constructs. I
guess, and now I insist, on that these problems would be connected to some
underlying design issues in the construct.

Other explanation could be that the documentation for Locator lacks
information about non-explained restrictions on the way it should be used to
avoid unexpected conflicts or behaviors. An especial and evident case occur
when dealing with Bezier curves, where if you drag a locator (a point in the
control polygon) all other locators conforming the control polygon move as
if they were being dragged too.

To summarize my experience with Locator: as soon as one goes beyond a toy (I
mean, beyond something rather simple), Locator becomes almost useless and 2D
sliders must be used instead.

E. Mart=EDn-Serrano

-----Mensaje original-----
De: Kevin J. McCann [mailto:k...@KevinMcCann.com]
Enviado el: mi=E9rcoles, 23 de mayo de 2012 9:29
Para: math...@smc.vnet.net
Asunto: Slow Locator in Manipulate

Kevin J. McCann

unread,
May 25, 2012, 4:58:46 AM5/25/12
to
I agree with most of your comments, especially the "underlying issues"
and poor (nearly nonexistent?) documentation. It seems that the folks at
Wolfram have been focused on providing new capabilities (very good) at
the expense of documentation (very bad).

It is not clear to me why 2d sliders should be any better, although I
agree that they are, since it would seem that the image must be redrawn
each time for either case.

I guess we will have to wait for the documentation to catch up.

Kevin

On 5/23/2012 8:01 AM, E. Martín-Serrano wrote:
> Kevin,
>
> I have reported similar problems in several occasions, with the Locator
> construct, even outside Manipulate but mostly inside Dynamic constructs. I
> guess, and now I insist, on that these problems would be connected to some
> underlying design issues in the construct.
>
> Other explanation could be that the documentation for Locator lacks
> information about non-explained restrictions on the way it should be used to
> avoid unexpected conflicts or behaviors. An especial and evident case occur
> when dealing with Bezier curves, where if you drag a locator (a point in the
> control polygon) all other locators conforming the control polygon move as
> if they were being dragged too.
>
> To summarize my experience with Locator: as soon as one goes beyond a toy (I
> mean, beyond something rather simple), Locator becomes almost useless and 2D
> sliders must be used instead.
>
> E. Martín-Serrano
>
> -----Mensaje original-----
> De: Kevin J. McCann [mailto:k...@KevinMcCann.com]
> Enviado el: miércoles, 23 de mayo de 2012 9:29

Kevin J. McCann

unread,
May 25, 2012, 4:59:47 AM5/25/12
to
Thanks to David Park, E. Martin-Serrano, and Fred Simons for responses.

The work around for this seems to be to use a Rasterized image of the
figure. It is not at all clear to me why this should be more CPU
efficient, but there is little or no documentation that helps. A lengthy
tutorial with examples on how Dynamic and its relatives work with
graphical output would be a big plus.

Kevin
0 new messages