Services & Resources / Wolfram Forums / MathGroup Archive
-----

MathGroup Archive 2012

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

Search the Archive

Slow Locator in Manipulate

  • To: mathgroup at smc.vnet.net
  • Subject: [mg126599] Slow Locator in Manipulate
  • From: "Kevin J. McCann" <kjm at KevinMcCann.com>
  • Date: Wed, 23 May 2012 03:28:51 -0400 (EDT)
  • Delivered-to: l-mathgroup@mail-archive0.wolfram.com

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



  • Prev by Date: Re: rHelp Finishing Mathematica Program
  • Next by Date: Data of non-trivial NonLinearFit
  • Previous by thread: Re: Question about ColorFunction
  • Next by thread: Re: Slow Locator in Manipulate