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

MathGroup Archive 2012

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

Search the Archive

Re: Slow Locator in Manipulate

  • To: mathgroup at smc.vnet.net
  • Subject: [mg126615] Re: Slow Locator in Manipulate
  • From: "Kevin J. McCann" <kjm at KevinMcCann.com>
  • Date: Fri, 25 May 2012 04:57:32 -0400 (EDT)
  • Delivered-to: l-mathgroup@mail-archive0.wolfram.com
  • References: <jpi3lf$4rt$1@smc.vnet.net>

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

On 5/23/2012 3:29 AM, Kevin J. McCann wrote:
> 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: Function Exp[x^2]*Erfc[x]
  • Next by Date: Re: On special polynomials decomposition
  • Previous by thread: Re: Slow Locator in Manipulate
  • Next by thread: Data of non-trivial NonLinearFit