Tag Info

Hot answers tagged

5

It seems to me that this double evaluation is simply part of the mechanism of Manipulate. When the slider is dragged one expression is displayed, and when it is released another is displayed. I described this a bit in PolarPlot render oddities but here is another example. I use ControlActive to make the behavior explicit but same action is implicit ...


3

I also consider this an inacceptable bug. Nevertheless I wanted to share a workaround which I think avoids the problem but is unfortunately a lot of effort to add to more complicated cases: CreateDocument[ DynamicModule[{x={500,500},lastValue}, Framed[ Slider[Dynamic[x[[1]]],{400,600}], ImageSize->Dynamic[ ...


3

I reported the issue discussed in this question to Wolfram technical support. I have received the following reply: It does appear that Animator is not behaving properly in this case and I have forwarded an incident report to our developers with the information you provided. On the basis of this reply, I have tagged this question with bugs.


3

Edit This is the workaround I've found : data = RandomReal[100, {10000, 10}]; Manipulate[ Block[{$PerformanceGoal = "Quality", a}, a = Log[i]; Grid[{{RandomReal[100]}, {ListPlot[a data[[;; , i]], PlotLabel -> RandomReal[100], ImageSize -> 400, PlotStyle -> Hue[RandomReal[1]], PerformanceGoal -> "Quality"]}}]], {i, 2, ...


3

Since the type Number won't allow formatted numbers to be displayed, set the accuracy (or precision) of the displayed value to control the number of digits: InputField[Dynamic[If[h2 == 0, 0., SetAccuracy[h2, 4]], (h2 = Round[#, 0.001]) &], Number] FullForm[h2] (* 0.468` *) It does have the disadvantage that numbers like 0.12 will be displayed as ...


3

Update for comment to make the movie without the slider showing: To make the above, used Manipulate, since little more flexible. Used Invisible Control. Here is the code. p = Manipulate[ Plot[u[x, t], {x, -4 Pi, 4 Pi}, Frame -> True, FrameLabel -> {{"u(x)", None}, {"x", Row[{"time", Spacer[2], AccountingForm[t, {2, 1}, ...


3

It's difficult to help you out without having definitions for your various graphs. If I understand your question, you want to pause an Animator at a particular spot. Here's a proof of concept example: DynamicModule[{i, t}, Column@{Animator[Dynamic[i], {0, 10}, AnimationTimeIndex -> Dynamic[t]], Dynamic@Plot[Sin[x + i], {x, 0, 10}], ...


2

data = Table[{x, x^2 + RandomInteger[10]}, {x, 1, 100}]; Manipulate[(p1 = Sort[p][[All, 1]]; nlm = NonlinearModelFit[Select[data, (E^p1[[1]] < #[[1]] < E^p1[[2]] &)], a x^b, {a, b}, x]; Show[ListLogLogPlot[data, PlotLabel -> {nlm[x], E^p}], LogLogPlot[nlm[x], {x, 0.1, 100}, PlotStyle -> Red]]), {{p, {{0., 0.}, {Log@100., 0.}}}, ...


2

Log Plots coordinates are confusing even built in things: Asymmetric X and Y error bars on ListLogPlot Locators positions p (exact graphics coordinates) are referring to actual coordinates (those indicated by Axes) like: Exp @ p. So if one want to plot a point on position {10,10^4} then Log @ {10,10^4} has to be provided. data = Table[{x, x^2 + ...


2

By measuring the time with the difference in AbsoluteTime from the beginning to the end of the While, I found it to be just less than 6 seconds. To increase this time, use at the beginning of the notebook, for instance, SetOptions[$FrontEndSession, DynamicEvaluationTimeout -> 60] which will run for several thousand steps. My thanks to Szabolcs for ...


2

Three changes are needed to make this code work: Move PrintTemporary inside the Do loop, so that it can access i. Remove i from the list of Module temporary variables. You may as well eliminate the symbol bar as well, because there is no need for it. Replace Dynamic[i] with With[{i = i}, Dynamic[i]], as aptly explained in "A Good Trick to Know" of ...


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


1

Does this answer you first concern? Manipulate[ t = Quiet[ Check[Import[url], {{"error, please provide a valid link"}}]]; Pane[TableForm[t], {Full, 300}, Scrollbars -> True, AppearanceElements -> None] , {{url, ""}, InputField[#, String, ImageSize -> {500, 35}] &}, {t, None} ] You can achieve this in many ways, the question ...


1

Another workaround, which allows to still have slider-like input, but is currently a bit inconvenient (ideas (with code) to improve are welcome!), is making a custom control. I've taken this answer as a starting example and reworked it to make it function when LocatorPane and the like don't work. It appears that MousePosition and EventHandler still appear ...


1

b = 1; ellipse[x_, y_, pt_] := (x^2)/(pt[[1]]^2 + b^2) + (y^2)/(b^2) DynamicModule[{pt = {0, 0}}, LocatorPane[Dynamic[pt], Dynamic@ContourPlot[ellipse[x, y, pt] == 1, {x, -2, 2}, {y, -2, 2}, Epilog -> {PointSize[Large], Point[Dynamic[{First[pt], 0}]], ...


1

s = FileNames["C:\\*.csv"]; selectfromAll = Select[s, StringMatchQ[#, ___ ~~ "rob" ~~ ___] &] Pane[Column[{CheckboxBar[Dynamic[selected], selectfromAll, Appearance -> "Vertical"], Dynamic[selected], Button["Import", imported = Import /@ selected]}]]



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