Tag Info

Hot answers tagged

11

CurrentValue["ControlsFontFamily"] (* "Segoe UI" on Version 9 / Windows 8 *) (* "Lucida Grande" on OS X 10.6.8 -- thanks: m_goldberg *) (* "Bitstream Vera Sans" on Fedora 20 -- thanks Oska *) CurrentValue["ControlsFontSize"] (* 12 on Version 9 / Windows 8 *) Style[StringJoin[CharacterRange["a", "z"]], FontFamily :> CurrentValue["ControlsFontFamily"], ...


5

For example: Manipulate[ LocatorPane[Dynamic[{x, y}], Graphics[{Red, Disk[]}]], {{x, 0}, InputField}, {{y, 0}, InputField} ]


5

You might use Row. For example: Manipulate[{u, v}, Row[{Control[{u, 0, 6}], Control[{v, 10, 20}]}, Spacer[10]]]


5

Perhaps this? Manipulate[ {names, slide, setter, cases}, Dynamic@Switch[cases, "custom", Control[{{names, True}, {True, False}}], "a", Control[{{slide, 0}, 0, 1}], "b", Control[{{setter, "das"}, {"das", "der", "die"}}]], {{cases, "custom"}, {"custom", "a", "b"}}] The variables seem to get localized properly even though the syntax ...


5

I'm adding this answer late because I think it would be good to have an example of OpenerView given as an argument to Manipulate, a common use-case for OpenerView. I also want to point out a special consideration which must be made when specifying controls in such a situation. SeedRandom[3]; With[{nMax = 16, rMax = 12., extent = 300}, With[{redPts = ...


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


5

Less ambitious: addbutton[manipulate_] := With[{box = ToBoxes@manipulate}, With[{proc = Cases[box, HoldPattern["Variables" :> _], ∞]}, With[{button = Button["Reset", CompoundExpression["Variables"] /. proc]}, Composition[ToExpression, BoxData][ box /. {("Body" :> x_) :> "Body" :> Column[{button, x}]}]]]] ...


4

You can try something like: RemoveScheduledTask @ ScheduledTasks[]; RunScheduledTask[c = Round[ControllerState["Y Axis"], .1], .1] Dynamic[{RandomReal[], c}] (*RandomReal tells us when c triggers updating*) Plot[{Sin[x]}, {x, 0, 2}, GridLines -> Dynamic[{{1}, {c}}]] So the Dynamic is not triggered by controller itself but by the value of it. It will ...


4

This is a bug in the Mathematica FrontEnd that appears on systems running Mac OS X 10.10. The cause is a change, beginning with Yosemite, in the behavior of the API used to draw the popup arrow. The FrontEnd bug will be fixed in an upcoming release.


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

Edited I don't like this much because what I take are intended to be the osculating circles don't have a radius equal to the radius of curvature. I used your formula, but it appears to be wrong. Nevertheless, what I've worked out does install a popup menu into a Manipulate expression which will select which parametric function will be displayed. It will ...


3

Not completely tested, based on undocumented structure of the DynamicModule constructed by Manipulate -- but it works for now: Manipulate[a + b + c, {{a, 1}, 0, 5}, {{b, 2}, 0, 5}, {c, 0, 5}, Button["Reset", Replace[ Typeset`specs, {{{Hold[var_Symbol], val_}, ___} :> (var = val), {Hold[var_Symbol], val_, ___} :> (var = val)}, 1]] ] ...


3

The problem is, that the Head of series is now Dynamic. With a simple Part you get rid of this: ListPlot[series[[1]], PlotLabel -> title] Besides, why not using Manipulate? Your problem seem perfectly suited for this: Manipulate[ forest = Range[30]; energy = Reverse[Range[30]]; Switch[choice , 1, series = forest; title = "Tree Growth" , 2, ...


2

You can place any controls inside an OpenerView: OpenerView[{"ButtonGroup", Column[{ Button["P5", Print[5!]], Button["P7", Print[7!]] }] }] Instead of OpenerView you could also use TabView or SlideView. I use this quite often to group, hide and open controls within a complex Manipulate. Keeps the screen clean.


2

Try this: OpenerView[{"", Column[{a^2 + b^2, Plot[Sin[x], {x, 0, 2 \[Pi]}], Speak["This is the opener view"]}]}]


2

Personally, I would stay with your first example, but if you insist on a more loose coupling between the button and the Export expression, maybe something like the following: filePath = FileNameJoin[{HomeDirectory[], "DeskTop", "test.jpg"}]; Manipulate[ p = Plot[Sin[x - n], {x, 0, 4 Pi}, ImageSize -> 300]; If[export, Export[filePath, p]; export = ...


2

If you are not insisting on calling the Manipulate-menu's bookmark, the following approach might do the job: Manipulate[Column[{Plot[TriangleWave[a x], {x, 0, 1}], Button["Custom Reset", (* first go back within the notebook *) SelectionMove[EvaluationNotebook[], Previous, Cell]; SelectionMove[EvaluationNotebook[], Previous, Cell]; ...


2

Something like this?: data = {1, 1, 2, 2}; DynamicModule[{max = Tr @ data, x}, Manipulate[ Normal @ SparseArray[Thread[x -> 1], max], ## ] & @@ Thread[{x, Internal`PartitionRagged[Range@max, data], ControlType -> TogglerBar}] ]


2

Are there really sufficiently many assignable pixel locations such that you can drag a Controller to such a resolution? Would you be satisfied if the range were small enough that the MinIntervalSize you seek could be rendered? After all, this will work: IntervalSlider[{.003, .007}, {0., .010}, ImageSize -> 600, MinIntervalSize -> .00000001, ...


1

I don't know how to fix it, but the issue seems to be with wrapping Dynamic around any kind of CurrentValue information: u = 0; Dynamic[Refresh[u++, TrackedSymbols :> {}, UpdateInterval -> 1]] (* Correctly updates: 1....2....3.. *) Dynamic[Refresh[ControllerState[4, "X1"], TrackedSymbols :> {}, UpdateInterval -> 1]] Dynamic[ControllerState[4, ...


1

Here's an idea: update[p_, pi_, i_] := ReplacePart[p (1 - pi)/Total[Drop[p, {i}]], i -> pi]; Manipulate[ p, {{n, 3}, Slider[Dynamic[n, (n = #; p = ConstantArray[1./n, n]) &], {2, 10, 1}] &}, {{p, ConstantArray[1./3, 3]}, ControlType -> None}, Control[ {{p, ConstantArray[1./3, 3]}, Dynamic[ Column @ Table[With[{i = i}, ...


1

But I need to also have it expandable so that I could view and enter the numeric value Maybe I am missing something, but why use ControlType for? Is this what you mean? Manipulate[ Plot[Sin[a x], {x, -3, 3}, ImageSize -> 600, AspectRatio -> 0.2], {a, -10, 10, Appearance -> "Labeled", ImageSize -> 600} ]


1

Generally, Dynamic is used in two ways: Re-evaluating expressions when they would change, and displaying the result. The syntax is Dynamic[expr]. Dynamic[expr] cannot be used to represent the value of expr in different context and calculate with it. It is only used to display it. Allowing controls to change values of variables. Typical syntax: ...


1

I believe the jump in value of asd happens because you're dragging the indicator with the mouse when the range is reset. Here is a way that does what you want, I think. It interrupts the mouse-dragging by creating a new Slider when the boundary is reached. {Dynamic@asd, Dynamic@Slider[Dynamic[asd], Which[asd < 10, {1, 10}, asd >= 10, {9, 50, ...


1

It looks to me like "Lucida Sans Unicode" on Windows or "Lucida Grande" on OSX. But it's hard to be sure. It'll render differently on Windows and OSX (and AFAIK also differently on older versions of Windows). I'm guessing your screenshot is from Windows, since the kerning is closer to that used by "Lucida Sans Unicode".


1

One can slightly rewrite your code and obtain a nice Manipulate f[x_, a_, μ_, σ_] := a Exp[-(x - μ)^2/(2 σ^2)]/(Sqrt[2 π] σ) n = 3; vars = Through@{a, μ, σ}@# & /@ Range[n]; func = f[x, ##] & @@@ test; values = {{50, 5, 20}, {50, 50, 40}, {100, 80, 20}}; rangelow = 0.7 values; rangehigh = 1.3 values; With[{func = func}, Manipulate[Plot[func, ...


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

I have a way of doing this by wrapping the label with a Panel. This has two effects: organizes space making a view more accurate and prevents jerking. Since you gave no code that can be played with, only the controls, I make here a simple example with two controls, just to demonstrate the way. Here you are: Manipulate[ Plot[Sin[\[Theta]*x], {x, 0, 2 ...


1

I downloaded and examined the CDF you refer to. I conclude from my examination that what looks like a highly stylized TabView may actually be a custom control built based on EvenHandler. Often when one sees what look like fancy versions of Mathematica controls in sophisticated CDFs, they are custom replacements such as the one you were looking at. As far as ...



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