Tag Info

Hot answers tagged

9

By default, DynamicModule uses SynchronousInitialization -> True. This causes the initialization to be performed on the preemptive link, disabling any updates to the front-end. In particular, print statements, cell creation and dynamic box updates will all be deferred until the initialization completes. If we wish to monitor that initialization within ...


7

Just a kickstart to get the equations right (yours are wrong) and an idea of the system dynamics: With[{Pr = 10, a = 1.181, b = 0.675, v = 0.77, l = 8/3}, pfun = ParametricNDSolveValue[{ x'[t] == Pr v (y[t] - x[t]), y'[t] == R (b/v) x[t] - a y[t] - (b/v) (R - (a v)/b) x[t] z[t], z'[t] == a l (x[t] y[t] - z[t]), x[0] == y[0] == 0.8, ...


7

SynchronousInitialization -> True causes dynamic evaluations to occur on the preemptive link. This locks up the notebook front-end for the duration of an evaluation. To avoid locking up the front-end indefinitely, there is a default timeout of six seconds: CurrentValue[EvaluationNotebook[], DynamicEvaluationTimeout] (* 6. *) The values we see for x ...


5

I do nor know how to implement what you want to do in a Manipulate expression using locators, because I don't know how to handle mouse events in a Manipulate expression. However, if you are willing to accept an answer using EventHandler, the behavior you ask for isn't very difficult to implement. With[{δ = .2}, DynamicModule[{p1 = {0, 0}, p2 = {2, 2}, ...


5

This is what I find more intuitive: circle[] := DynamicModule[{a = {0, 0}, b = {1, 0}, r = 1, w}, { Dynamic@Circle[a, r], Locator[Dynamic[a, {(w = b - a) &, (a = #; b = a + w) &, None}]], Locator[Dynamic[b, (b = #; r = Norm[b - a]) &]] }] Graphics[circle[], Frame -> True, PlotRange -> 2] And this is what fits well ...


4

The following will do what you ask, but likely not as expediently as you hoped for. SeedRandom[42]; With[{data = RandomInteger[100, 100]}, With[{xspan = Length@data, yspan = Max@data}, DynamicModule[{mag, center, box, plotCenter}, Column[{ ClickPane[ Dynamic @ ListPlot[data, PlotRange -> box[center], ...


3

Here's a version with checkboxes: numData = 4; data = Sort /@ RandomReal[{0, 10}, {5, numData, 2}]; legend = Table["data" <> ToString@i, {i, numData}]; DynamicModule[ { dataCombinations = {} } , Grid @ {{ CheckboxBar[ Dynamic @ dataCombinations, Thread[Range[numData] -> legend], Appearance -> "Vertical" ...


3

Consider: plot1 = Plot[Sin[x], {x, 0, 6 Pi}]; plot2 = Plot[Cos[x], {x, 0, 6 Pi}]; TogglerBar[Dynamic[p], {plot1 -> "Plot 1", plot2 -> "Plot 2"}] Dynamic[p /. {x__} :> Show[x]] See TogglerBar and CheckboxBar.


3

Using some made-up test data to illustrate. This approach is also used here with fading transitions. data1 = Table[Sin[x], {x, 0, 2 Pi, Pi/4}]; data2 = Table[Cos[x], {x, 0, 2 Pi, Pi/4}]; plot1 = ListLinePlot[data1, DataRange -> {0, 2 Pi}]; plot2 = ListLinePlot[data2, DataRange -> {0, 2 Pi}]; id = ImageDimensions[plot1]; Manipulate[Graphics[{White, ...


2

I can confirm that this occurs (using the above code and clicking "panel format…") using Mathematica v.10.0.0 on OS X 10.9.4 (64-bit). I can't provide any further help on the MWE for this, as I'm still learning to use MMA as a coding language, rather than a fancy CAS. I've uploaded a copy of the OS X crash log here. EDIT: As Mr. Wizard observed, this ...


1

Based on comments, I came to the following approach: DynamicModule[ {nn, tn, dist, dataAll, data, dx, func, wave, f}, ColumnForm[{ Button["New data", dataAll = RandomVariate[dist, 2000]; data = Take[dataAll, nn]; func = CalcG1[wave, data, 0, Ceiling[Log2[nn] - Log2[Log2[nn]]]]; f = func[tn]; ], PopupMenu[Dynamic[wave, ...


1

You can do the following as a workaround in M9. EventHandler["t",{"KeyDown":> If[CurrentValue["EventKey"]=="a", Print["a"] ] } ]


1

x = {3, 3}; y = {5, 3}; LocatorPane[Dynamic[{x, y}], Dynamic@Graphics[{{Gray, Circle[x, Abs[y[[1]] - x[[1]]]]}, {Blue, PointSize[0.02], Point[{x, {y[[1]], x[[2]]}}]}}, Axes -> True, PlotRange -> {{-2, 8}, {-2, 8}}, AxesOrigin -> {0, 0}], Appearance -> None]


1

Perhaps you can use DiscretePlot3D {alist, blist} = RandomReal[{-2 Pi, 2 Pi}, {2, 20}]; Manipulate[DiscretePlot3D[f[a + b], {a, alist}, {b, blist}, PlotStyle -> Hue[RandomReal[]], ExtentSize -> Scaled[.5]], {f, {Sin, Cos}}]



Only top voted, non community-wiki answers of a minimum length are eligible