Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.soft-sys.math.mathematica > #16496
| From | Gregory Lypny <gregory.lypny@videotron.ca> |
|---|---|
| Newsgroups | comp.soft-sys.math.mathematica |
| Subject | Re: Need Help With Locator in a Manipulate |
| Date | 2014-01-28 11:11 +0000 |
| Message-ID | <lc8399$3v8$1@smc.vnet.net> (permalink) |
| References | <20140126081421.81CD369D3@smc.vnet.net> |
| Organization | Time-Warner Telecom |
Thanks again Bob,
Much appreciated as always. I figured out how to stop the jiggle. I put the statement for resetting the locator in the Epilog of the plot in the way I described in my previous email
Locator[Dynamic[pt2, pt2 = {pt2[[1]], m pt2[[1]] + pt1[[2]] - m*pt1[[1]]}]]
and in the control section of the Manipulate, I set the Appearance of the locator to None.
{{pt2, {25, 80}}, Locator, Appearance -> None},
That way the locator is visible only in its reset position. Its pretty smooth now. I'm going to include your tooltips. Nice idea!
Gregory
On Sun, Jan 26, 2014, at 4:55 PM, Bob Hanlon <hanlonr357@gmail.com> wrote:
> I don't know how to stop the giggle but this adds tooltips over the locators. I also changed the definition of the curve to be a more direct function of x.
>
> Manipulate[
> Module[
> {f, b, xmin = 0, xmax = 100},
> b = pt1[[2]] - m*pt1[[1]];
> f[{x1_, y1_}, x_] = (x1/x)^(a/(1 - a)) y1;
> pt2 = {pt2[[1]], m pt2[[1]] + b};
> Plot[{f[pt1, x], m x + b},
> {x, 0, 100},
> Epilog -> {White,
> Tooltip[Disk[pt1, {1, 2}], StringForm["pt1 = ``", pt1]],
> Tooltip[Disk[pt2, {1, 2}], StringForm["pt2 = ``", pt2]]},
> AxesOrigin -> {0, 0},
> PlotRange -> {{xmin, xmax}, {Automatic, 200}}]],
> {{a, .5, "Shape (a)"}, .2, .8, .01,
> Appearance -> "Labeled"},
> {{m, -1, "Slope (m)"}, -3, -.4, .01,
> Appearance -> "Labeled"},
> {{pt1, {10, 80}}, Locator},
> {{pt2, {50, 40}}, Locator}]
>
>
> Bob Hanlon
Back to comp.soft-sys.math.mathematica | Previous | Next | Find similar
Re: Need Help With Locator in a Manipulate Gregory Lypny <gregory.lypny@videotron.ca> - 2014-01-28 11:11 +0000
csiph-web