Tag Info

New answers tagged

4

Manipulate[ToExpression[func, TraditionalForm] /. x -> val, {{val, Pi, "x"}, InputField}, {{func, "", "f(x)"}, InputField[##, String] &}]


2

To answer your question literally, you could specify an ImageSize in the Graphics. Note that Animate (as opposed to Manipulate) actually fixes the box size for you. Manipulate is a "stupid" function in that it will just spit out exactly what you have inside it (this is more powerful in general). What you are probably looking for though is fixed coordinates, ...


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


1

Quick answer put it as a specification of the controller Manipulate[x, {{x, 0}, 0, 100, BaseStyle -> FontSize -> 25}, ControlType -> InputField] Quick notes Nonuniform styles handling is really annoying, one have to always remember what can be inherited and what not or put explicit directives everywhere. I asked it already in Are there ...


2

You have a few syntax errors. Here you have them corrected and an example on how to change each component styling: Manipulate[ y[t] /. First@ DSolve[{a y''[t] + b y'[t] + c y[t] == r, y[t0] == ic, y'[t0] == icp}, y[t], t], {{a, 1, "a"}}, {{b, 1, "b"}}, {{c, 1, "c"}}, {{r, 0, "r(t)"}}, {{t0, 0, "t0"}}, {{ic, 0, "y[t0]"}}, {{icp, 0, Style["y'[t0]", ...


0

Replacing two instances of e by j in the code allows it to run correctly both as a notebook and a cdf.


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


0

For example: f[x_, b_] := x^2 + b Manipulate[Plot[f[x, b], {x, 0, 5}, ImageSize -> Large, PlotRange -> All, AxesOrigin -> {0, 0}], {{b, 0.1}, 0, 2}]


4

I think I've found the guilty : this is PlotTheme Since the problem seems to only occur when "plot" functions are involved, for example here : Manipulate[Grid[{{RandomReal[10]}, {Plot[Sin[x], {x, 0, 2 Pi}]}}], {a, 1, 3}] Manipulate[Grid[{{RandomReal[10]}, {ListPlot[Range[10]]}}], {a, 1, 3}] Manipulate[ Grid[{{RandomReal[10]}, {ParametricPlot[{Cos[t], ...


3

EDIT: Everyone reading this should be aware that SquareOne's answer contains the real reason and the best way to get rid of these unwanted updates. I'll leave my answer here as I think it shows useful techniques to avoid unwanted updates in similar cases but using PlotTheme->None is certainly the best solution to the OPs problem... It probably could be ...


1

I don't think that anything is wrong with Michaels answer but I wanted to mention that the following does what I think you expect in a somewhat more straightforward way: Manipulate[ Dynamic[output, TrackedSymbols :> {output}], Button["do", output = "Paused..."; FinishDynamic[]; Pause[3]; output = "done", Method -> "Queued" ], {output, ...


0

It's not too hard. Manipulate[ vBwGFunc[vAwGIn, psiIn, vBwBIn] // MatrixForm, {{vAwGIn, vAwG[[1]], "A"}, Thread[Rule[vAwG, vAwG // MatrixForm]]}, {{psiIn, psi[[1]], "ψ"}, psi}, {{vBwBIn, vBwB[[1]], "B"}, Thread[Rule[vBwB, vBwB // MatrixForm]]}]


1

I'm not entirely sure what you're after. Here are two ideas. The first one preserves the waiting 3 seconds. If that's not important, see further down. Manipulate[output, {{output, "new", ""}, DynamicModule[{timer = Infinity}, Button[ DynamicWrapper["do", If[Clock[{0, Infinity}] >= timer + 3, output = "done"]], output = ...


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

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

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


1

The errors occur whenever a==b since the domain of the plot is just a point which is not allowed. Consequently, you must handle a==b as a special case. It also helps to fix the PlotRange. myPlot[a_, b_] := ParametricPlot3D[ {1, x, Sin[x]}, {x, a, b}, PlotRange -> {{0, 2}, {-1, Pi}, {-1, 1}}]; Manipulate[ Piecewise[{ {Graphics3D[ Point[{1, ...


1

myPlot[a_, b_] := ParametricPlot3D[{1, x, Sin[x]}, {x, a, b}]; Manipulate[Show[myPlot[a, b]], {{a, -1}, -1, Pi}, {{b, 1}, -1, Pi}]


0

I feel like there is a duplicate, but I was not able to find this. This one is related e.g: 1199 All you need is: With[{y = y}, Manipulate[ Plot[y, {k, 1, 10}], Evaluate @ Array[{Subscript[b, #], 0, 1} &, constraint, 1, Sequence] ]] You sould be able to figure it out with documentation. Evaluate is for the same purpose as your With. p.s. It ...


4

I consider this a bug. Although I have no solution, I can provide some further insights. The behavior seems to depend on the usage of any plotting command or commands that display something. The smallest example I could find is Dynamic[{Plot[Null, {a, 0, 1}], AbsoluteTime[]}] A simple static Graphics seems not enough, but if you use a Graph instead of the ...


1

I did something like this using Animate once. Here is a Manipulate version. Manipulate[ r = 1; Show[{ ListPlot[Table[{x - Sin[x], 1 - Cos[x]}, {x, 0, t, .1}], Joined -> True, AspectRatio -> Automatic, PlotRange -> {{-3, 20}, {-2 r, 3 r}}, ImageSize -> 500], Graphics[{Blue, PointSize[Large], Point[{t - Sin[t], 1 - ...



Top 50 recent answers are included