Tag Info

Hot answers tagged

6

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, ...


4

You can include an iterator along with the function in the mapping: k = 0; (++k; f[#]) & /@ Range[100];


3

n = 3; Manipulate[Graphics[{Circle[{0, 0}],Line[{{0, 0}, a[[#]]} & /@Range[Length@a]]}], {{a, RandomReal[{0, 1}, {n, 2}]}, Locator, LocatorAutoCreate -> True}] Alternatively, Manipulate[Graphics[{Circle[{0, 0}], Line[Tuples[{{{0, 0}}, a}]]}], {{a, RandomReal[{0, 1}, {n, 2}]}, Locator, LocatorAutoCreate -> True}]


3

Specifying an explicit PlotRange and moving the Dynamic outside the list in Graphics3D seems to create a smoother experience: DynamicModule[{vv = {0, 0, 1}, vp = {1.3`, -2.4`, 2.`}}, Graphics3D[ Dynamic[{Cuboid[], Line[{{0, 0, 0}, vv}]}], ViewPoint -> Dynamic[vp], ViewVertical -> Dynamic[vv], Boxed -> False, SphericalRegion ...


3

Download code You can download a notebook with all the code in it by running the following code: Import["http://goo.gl/NaH6rM"]["http://i.stack.imgur.com/sMWJ2.png"] Code with comments The first thing to do is to separate your headings from your data: rawdata = {{"n", "t(n)", "t(n)/t(n-1)", "Ø(t(n)/t(n-1))"}, {20., 1.15, "", 1.30081}, {21., 1.54, ...


3

Is this what you mean? Manipulate[ Grid[{{txt}, {idx}}], Grid[{ {"T", InputField[Dynamic[txt, {txt = #; idx = StringLength[txt]} &], String, ContinuousAction -> True]}, {"index", Manipulator[Dynamic[idx, {idx = #} &], {0, Dynamic@StringLength[txt], 1}], Dynamic[idx]} }], {{txt, ""}, None}, {{idx, 0}, None} ]


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]}]


3

It seems to work if I remove the extraneous calls to Dynamic. Manipulate[ {p[[#]] & /@ Range[5], Select[p[[#]] & /@ Range[5], (#[[1]] != #[[2]]) &]} // TableForm, {p, None}, {{np, "", "Test"}, Column[{Dynamic[sP /@ Range[5] // Row, TrackedSymbols :> {np}]}] &}, Initialization :> ( np = 5; sP[i_] := ...


2

I observe no problem here: make[] := Manipulate[x^2, {x, 1, 5}] PasteButton["A dynamic object", make[]] // CreatePalette Perhaps you forgot to localize your variables with DynamicModule which Manipulate makes use of automatically?


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, ...


2

I agree with Rojo's comments under his answer and I'd upvote them but the example from tutorials given in his answer is more confusing than educational for me (as expressed in comments). "For me", not "in my opinion" so maybe one can learn more from this part of tutorial. Nevertheless, I want to show you examples were using Refresh really matters. Refresh ...


1

for completeness here is the LocatorPane version suggested by @m_goldberg comment. DynamicModule[{pt = RandomReal[{-1, 1}, {3, 2}]}, LocatorPane[Dynamic@pt, Graphics[{Circle[], Line[{{0, 0}, Dynamic@pt[[#]]}] & /@ Range@Length@pt}]]]


1

The following might give you some idea how it could be done. I assume that your regions are given by a Boolean function of two arguments, and therefore can be displayed with RegionPlot. For example, when your region is a circle, the region function is region=#1^2+#2^2<=1& and the region can be displayed as follows: RegionPlot[region[x,y], ...


1

You may consider moving the variables used for the dynamic clock into a dedicated context Dynamic[{clock`d, clock`h, clock`m, clock`s} = List @@ DateDifference[Now, DateObject[{2015, 5, 18}], {"Day", "Hour", "Minute", "Second"}][[1]]; Grid[Transpose@{{"d", clock`d}, {"h", clock`h}, {"m", clock`m}, {"s", Round@clock`s}}, Alignment ...


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 = ...



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