Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.soft-sys.math.mathematica > #9527
| From | Scott Colwell <scolwell@uoguelph.ca> |
|---|---|
| Newsgroups | comp.soft-sys.math.mathematica |
| Subject | Clear variable on Locator point change |
| Date | 2012-04-09 09:37 +0000 |
| Organization | Steven M. Christensen and Associates, Inc and MathTensor, Inc. |
| Message-ID | <jluali$rsa$1@smc.vnet.net> (permalink) |
Hi Folks,
Can anyone help me out with this problem. I am plotting locator points on
a graph and then having x and y listed on a table. Then some mathematical calculations are done on x and y. Give there are 15 points, having the calculations update on each move makes it too slow, so I've added a button that will be used to update the calculations after the locator points have been moved.
What I would like to do is clear the variables of the calculations on the next movement of the locator point. Here is the idea below. Once the locator is moved, you click update to get the xy calculation. What I'm looking for is for xy to clear in the table on the next move of that locator. Then the update button can be selected again. Then repeated.
Thank you for your help.
Manipulate[
x1 = Extract[Flatten[SetPrecision[p1, 4]], 1];
y1 = Extract[Flatten[SetPrecision[p1, 4]], 2];
pts = List[p1];
plotpoints =
ListPlot[pts, PlotRange -> {{69, 88}, {68, 82}},
PlotRangeClipping -> False, ImageSize -> 550 ,
Frame -> {True, True, False, False} ];
Column[{Row[{Show[plotpoints, AxesOrigin -> {69, 67},
PlotRange -> {{69, 88}, {67, 82}}]}]}],
Column[{
Pane[
Grid[{{"", "", "",
Button["Update All", {xy = SetPrecision[x1*y1, 6]},
ImageSize -> 200], SpanFromLeft},
{Style["Participant", Bold], Style["x", Bold], Style["y", Bold],
Style["xy", Bold], Style["x sq", Bold],
Style["ysq", Bold] },(*First Row of Table Titles*)
{"1", Dynamic[x1], Dynamic[y1], Dynamic[xy], "", ""}
}, Frame -> All, ItemSize -> {{8, 9, 9, 10, 9, 9}, 1.2},
Alignment -> {{Center, Center, Center, Center, Center,
Center}, {Center, Center, {Bottom}}},
BaseStyle -> FontFamily -> {"Ariel", 12},
Background -> {None,
None, {{{1, 2}, {1, 6}} -> Lighter[LightGray]}},
Dividers -> {False, {True, False, True, {False}, True, False,
False, True}}]
]
}],
{{p1, {84.56, 79.21}}, Locator, ControlType -> None}, {{xy, 6698},
ControlType -> None}
]
Back to comp.soft-sys.math.mathematica | Previous | Next | Find similar | Unroll thread
Clear variable on Locator point change Scott Colwell <scolwell@uoguelph.ca> - 2012-04-09 09:37 +0000
csiph-web