Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.soft-sys.math.mathematica > #10187 > unrolled thread
| Started by | "Kevin J. McCann" <kjm@KevinMcCann.com> |
|---|---|
| First post | 2012-05-23 07:29 +0000 |
| Last post | 2012-05-25 08:59 +0000 |
| Articles | 2 — 1 participant |
Back to article view | Back to comp.soft-sys.math.mathematica
Slow Locator in Manipulate "Kevin J. McCann" <kjm@KevinMcCann.com> - 2012-05-23 07:29 +0000
Re: Slow Locator in Manipulate "Kevin J. McCann" <kjm@KevinMcCann.com> - 2012-05-25 08:59 +0000
| From | "Kevin J. McCann" <kjm@KevinMcCann.com> |
|---|---|
| Date | 2012-05-23 07:29 +0000 |
| Subject | Slow Locator in Manipulate |
| Message-ID | <jpi3lf$4rt$1@smc.vnet.net> |
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
[toc] | [next] | [standalone]
| From | "Kevin J. McCann" <kjm@KevinMcCann.com> |
|---|---|
| Date | 2012-05-25 08:59 +0000 |
| Message-ID | <jpnhm3$qbi$1@smc.vnet.net> |
| In reply to | #10187 |
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
>
[toc] | [prev] | [standalone]
Back to top | Article view | comp.soft-sys.math.mathematica
csiph-web