Tag Info

New answers tagged

2

A simple workaround is to use Part and SlotSequence like this: ColorData[col][{##}[[n]]] Another workaround is to generate the function that is applied (@@@) with another function: pointslf[1] = RandomReal[1, {12, 7}]; Manipulate[DynamicModule[{min, max, col, fn}, {min, max} = Through@{Min, Max}@pointslf[1][[All, n]]; col = {"TemperatureMap", {min, ...


3

You can do this: Manipulate[Evaluate@Sin[Slot[n]] &[0, Pi/2], {{n, 1}, Range[2]}] but I don't think it is as handy as: Manipulate[Sin[{0, Pi/2}[[n]]], {{n, 1}, Range[2]}]


1

Manipulate version. Manipulate[ Row@string , Column[{Dynamic[pop /@ Range[n] // Row, TrackedSymbols :> {n}], SetterBar[ Dynamic[x, If[# === "+", n++; string = Join[string, {"a"}], n--; string = Most@string] &], {"+", "-"}]}] , {x, None}, {n, None}, {string, None} , Initialization :> ( pop[i_] := With[{j = ...


4

OK, I guess I found something myself while trying to circumvent RunScheduledTask. DynamicModule[{prog = False}, Column[{ Button[ "Do heavy work", prog = True; Pause[10]; prog = False, Method -> "Queued" ], Dynamic@If[prog, ProgressIndicator[Appearance -> "Percolate"], Invisible[ProgressIndicator[Appearance ...


5

I'm not sure if this is exactly what you need but this is what I've recently done to inform the user about ongoing calculation. Usage withProgressIndicator[proc, delay] Performs a proc, and when it lasts longer than delay (default 0), a progress indicator in dialog is created. It will be closed after finishing the proc. It should be run on Main Link, ...


3

Column[{Panel["Panel 1"], Panel["Panel 2"], Mouseover[Panel["Panel 3"], Column@{Panel["Panel 3"], Panel["Extra Panel"]}], Panel["Panel 4"]}, Spacings -> {0, 0}] Or Column[{Panel["Panel 1"], Panel["Panel 2"], Dynamic@If[CurrentValue["MouseOver"], Column@{Panel["Panel 3"], Panel["Extra Panel"]}, Panel["Panel 3"]], Panel["Panel 4"]}, ...


5

The problem is that trajectory[f] passes the Symbol f to Manipulate, so that the Manipulate updates to the new f whenever the definition of f is changed. The trick is to somehow to evaluate f so that the symbol f is replaced by its definition before it is injected into the Manipulate code. Method 1: ClearAll[soln]; soln[f0_, y0_] := Function[t0, y[t0] ...


1

I haven't tested this with data, perhaps you can post some example data. I've assumed the lists of data you import are all numbers. If you are unsure then you would need additional tests on the imported data before doing the calculation (see MatrixQ, VectorQ and their 2nd arguments). Also I suspect that PopupWindow would be a better choice than ...


3

I find answer in Help system! It's necessary to write a = DynamicSetting[Checkbox[]] and evaluate it in place by Cntrl+Shft+Enter. That`s all!


4

With small modifications of the code provided by m_goldberg you can get the Button and the ProgressIndicator in the same Row. However, it is always there now and will not appear and disappear. DynamicModule[{n = 1}, Row[{Button["Start", n = 1; Do[Pause[0.1]; ++n, {i, 1, 100}], Method -> "Queued"], Spacer[23], Dynamic[ProgressIndicator[n, {1, ...


3

You are looking for this: {InputField[Dynamic[x], Hold[Expression]], Dynamic[ReleaseHold[x]]}


3

The closest I can get to what you ask for is DynamicModule[{n}, Button["Start", n = 0; Monitor[Do[Pause[0.1]; ++n, {i, 1, 100}], Dynamic[ProgressIndicator[n, {1, 100}]]], Method -> "Queued"]] which, after the button is clicked on, produces The progress indicator appears in its own temporary cell, not in a row with the button. ...


2

This can be done with Clock. The following will import foo.json every 5 seconds. With[{update = 5}, Dynamic[{foo = Import["~/Desktop/foo.json"], Clock[{1, update, update}, update]}]]


11

Update: Adding a button to print a snapshot: Manipulate[Module[{a = {{2, 3}, {3, 2}}, vp}, vp = VectorPlot[a.{x, y}, {x, -4, 4}, {y, -4, 4}, VectorScale -> {0.045, 0.9, None}, VectorPoints -> 16]; z = NDSolveValue[Thread[{x'[t], y'[t], x[0], y[0]} == Join[a.{x@t, y@t}, #]], {x@t, y@t}, {t, -2, 1}] & /@ u; plot = ParametricPlot[z, ...


7

Using the "almost new" feature of NDSolve[] that allows it to detect vector equations based upon the dimensions of the initial conditions. a = {{2, 3}, {3, 2}}; vp = VectorPlot[a.{x, y}, {x, -4, 4}, {y, -4, 4}, Axes -> True, AxesLabel -> {x, y}, VectorScale -> {0.045, 0.9, None}, VectorPoints -> 16]; ...


3

A simple solution would be to wrap those expressions into a DynamicModule: DynamicModule[{vp, vv} , {vp, vv} = Options[Graphics3D, {ViewPoint, ViewVertical}][[All, 2]] ; { Graphics3D[Cuboid[], ViewPoint->Dynamic[vp], ViewVertical->Dynamic[vv]] , Graphics3D[Cuboid[], ViewPoint->Dynamic[vp], ViewVertical->Dynamic[vv]] } // GraphicsRow ] ...


1

I think you are working too hard. If you just want to put a plot below your input fields, you can do it like this. asq[a_] := a*a DynamicModule[{a = 2}, Style[ Panel[Dynamic @ Column[{ Grid[{ {Style["Input number", Blue], InputField[Dynamic[a], Number]}, {Style["Square of number", Red], ...


1

I reported a problem with Opener and Appearance option, this is the reply: [CASE:2678632] Feedback [...] There is an 'Appearance' issue on the Windows platform and it has been reported already. [...] So I believe it is a subject to change. As a temp. replacement: opF = Opener@False~Rasterize~(ImageSize -> 12); opT = ...


0

coaxing Manipulate to do what you want seems to be a bit of a black art. Perhaps there is cleaner way but this seems to work.. Clear[a,b,c,d]; Manipulate[ m=Map[#[[1]] &, First@(List @@ matrix), {2}]; MatrixForm@m, {matrix, Grid[Map[InputField[Dynamic@#, FieldSize -> 5] &, {{a, b}, {c, d}}, {2}]]}] ...


0

Ok, so I have figured one big thing out. instead of: {a,-10,10,1} (this defines a slider of range -10 to 10 with a step of 1) replace the numbers with InputField {a,InputField} and then you can replace a with different names and a value seen on my e-i variables I still can't find out how to make it look like a 2x2 matrix. a b c d instead of a b ...


8

I wrote something to do something a little like what you wanted. Here I've adapted it so you can get a run through for each setting of the SetterBar. Some description of the functions. autolist[control_pattern] := list of manipulate settings for the animation specs is a pattern for culling variable specifications out of a Manipulate ...


9

You can define a function that creates Manipulates with a "fake" SetterBar and a specific AutorunSequencing m[k_, seq_] := Manipulate[ Plot[{Sin[a*x] + b*Cos[3 a*x], k*x}, {x, 0, Pi}, ImageSize -> 400], {a, 1, 2}, {b, 0, 1}, Grid@{{"k", SetterBar[k, {0, .5, 1}]}}, AutorunSequencing -> seq, ContentSize -> {420, 270}] then create the frames ...


6

The export to movie is easy. (just write p=Manipulate[..] then export p to movie. Controlling the sequences as you want, I think have to be programmed in. Autorunsquences does not give one full control of all the scenario needed. Here is the Manipulate you have. It runs in 2 modes. Automode, runs pre-programmed scenario. Click again, turn this off, so you ...


7

This is just an idea how to prepare frames to export, don't have time for more now: f = Interpolation[ { {0, {1, 0, 0}}, {1, {2, 0, 0}}, {2, {2, 1, 0}}, {2.02, {1, 0, .5}}, {3, {1, 0, .5}}, {4, {2, 0, .5}}, {5, {2, 1, .5}}, {5.02, {1, 0, 1}}, {6, {1, 0, 1}}, {7, {2, 0, 1}}, {8, {2, 1, 1}} }, InterpolationOrder -> ...


3

You can just use AppendTo, I added a Pause since it happens so fast otherwise vals = {}; Dynamic[ListPlot[vals]] FindMinimum[x1^4, {x1}, StepMonitor :> (AppendTo[vals, x1]; Pause[.5])]


4

Your code can be simplified. In particular, I recommend that you get rid of the embedded DynamicModule and, instead, use a common trick of defining invisible controls to localize temporary variables. Manipulate[ s0 = 1 - i0; γ = 1/l; sol = NDSolve[{ s'[t] == -β/(E^(k (t - τ)))*s[t]*i[t], i'[t] == β/(E^(k (t - τ)))*s[t]*i[t] - γ*i[t], ...


4

Change: sol = NDSolve[ ___ ] ... By sol = First@NDSolve[ ___ ] result:


2

You might want to consider a simple implementation with a Toggler. The only change you will need to make to your code is to explicitly set the image size of the histograms (because if the image size option is left at the default Automatic, the Toggler will shrink them down). Reproducible data. SeedRandom[42]; data1 = RandomVariate[NormalDistribution[0, ...


1

This will easily generalize to more than two histograms: Manipulate[ Switch[whichHistogram, 1, histo1, 2, histo2 ], {{whichHistogram, 1, "Choose histogram"}, {1 -> "blue", 2 -> "green"}} ]


0

I'm not sure whether the following will fulfill all of your requirements as it does make a copy of the part which is to be shown. But that copy is only used to control when updates are needed and only within a purly local variable. This should not be a problem concerning the updating of the original symbol, but in case you are concerned about the memory ...


1

Few notes: try to avoid Manipulate for complex things. When you have multiple controllers (of the same variable) inside body of Manipulate it triggers evaluation unless you use nested Dynamic/Refresh. Moreover, referring your last example, take a look at: Function[{m, r}, Round[m, r]][Dynamic[5.5], 1]. DynamicModule[{n = 10.123, interval = {10, 20}}, ...



Top 50 recent answers are included