Tag Info

Hot answers tagged

10

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


7

There are many ways to do this. The most basic is to use Control, added few versions earlier just for this purpose. Here is an example. Control can be inserted inside Row or Column or Grid for example Manipulate[x, Row[{Control[{{x, 1, "x="}, 0, 1, .1}], Spacer[5], Dynamic[x], Spacer[2], "meters"}] ]


4

You can use Quantity to specify the initial value and domain of a control: Manipulate[x, {{x, Quantity[1, "Meters"], "x ="}, Quantity[Range[0, 1, .1], "Meters"], ControlType -> Manipulator , Appearance -> "Labeled"}] Few more alternatives: Manipulate[Quantity[x, "Meters"], Row[{Control[{{x, 1, ...


4

Manipulate[{sx = NDSolve[{x''[t] + (2 k1)/m (x[t] - a) == 0, x[0] == x0, x'[0] == vx0}, x[t], {t, 0, 10}]; sy = NDSolve[{y''[t] + (2 k2)/m (y[t] - a) == 0, y[0] == y0, y'[0] == vy0}, y[t], {t, 0, 10}]; Graphics[{Disk[{Evaluate[x[t] /. sx][[1]], Evaluate[y[t] /. sy][[1]]}, 0.4]}, PlotRange -> 6] /. t ...


4

As Kuba mentioned, you can quite easily work out the trig relations to give the endpoints directly, using RotationTransform: RotationTransform[q] /@ {RotationTransform[r]@{(a + b)/2, 0}, RotationTransform[-r]@{(a + b)/2, 0}, RotationTransform[r]@{-a, 0}, RotationTransform[-r]@{-b, 0}} which produces the coordinates of the red dots: {{1/2 (a + b) ...


2

Manipulate[ParametricPlot[{w Sin[u + v + y], z Cos[(u + v) x]}, {u, 0, 2 Pi}, {v, 0, 2 Pi}, PlotRange -> {-1, 1}], {{w, .5}, 0, 1}, {{z, .5}, 0, 1}, {{x, .5}, 0, 1}, {{y, Pi}, 0, 2 Pi}]


2

you can try also this: x1[t_] := t*Cos[c] - t^2*Sin[c]; u1[t_] := t*Sin[c] + t^2*Cos[c]; Manipulate[ ParametricPlot[{x1[t], u1[t]} /. c -> d, {t, -3, 3}, PlotRange -> {{-9, 9}, {-9, 9}}], {d, 0, 2}]


2

Manipulate[ ParametricPlot[RotationMatrix[c].{t, t^2}, {t, -2, 2}, PlotRange -> {{-5, 5}, {-5, 5}}], {c, 0, 2 Pi}] Other transformations can be handled the same way. For example for SL2(R) Manipulate[ ParametricPlot[LinearFractionalTransform[{{{a, b}, {c, (1 + b c)/a}}}][{t,t^2}], {t, -5, 5}, PlotRange -> ...


1

I think you need something like Manipulate[P, {a, 0, 1, 0.01}, {P, {a, 0}, {1, 1}, ControlType -> Slider2D}]


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

Framed[ Row[{ "Interval", IntervalSlider[Dynamic[m], {0, 3, 0.1}, Appearance -> "Markers"], Dynamic[m], " meters"}], Background -> GrayLevel@0.9, FrameMargins -> 15] Thanks to alancalvitty's comment: Much nicer is: Framed[ Row[{ "Interval", IntervalSlider[ Dynamic[m], {0, 3, 0.1}, Appearance -> "Markers"], ...


1

Generally you access it using the construct pt[[pos]], where "pos" specifies the position of the element in the list of the locator points. In the case at hand it is the list {{0, 0}, {1, 0}, {1, 1}, {0, 1}, {1, -1}}. Its second element, {1,0}, for example is given by pt[[2]], while the first subelement of the second element (i.e. 1) - by pt[[2,1]]. Try the ...


1

Okay, if I let x1 and u1 be functions of c also, this seems to work: x1[t_, c_] := t*Cos[c] - t^2*Sin[c]; u1[t_, c_] := t*Sin[c] + t^2*Cos[c]; Manipulate[ ParametricPlot[{x1[t, c], u1[t, c]}, {t, -3, 3}, PlotRange -> {{-9, 9}, {-9, 9}}], {c, 0, 2}]


1

dur = Times; Manipulate[ Text@Style[ Grid[{{Row[{"Total fill volume is ", totalVolume}]}, {Row[{"Delivery rate is ", deliveryRate}]}, {Row[{"Product duration is ", dur[totalVolume, deliveryRate]}]}, {Row[{}]}, {Row[{"Initial pressure is ", initialPressureG}]}, {Row[{"Drop in pressure is ", pressureDrop, "%"}]}}, ...


1

Based on comments, I came to the following approach: DynamicModule[ {nn, tn, dist, dataAll, data, dx, func, wave, f}, ColumnForm[{ Button["New data", dataAll = RandomVariate[dist, 2000]; data = Take[dataAll, nn]; func = CalcG1[wave, data, 0, Ceiling[Log2[nn] - Log2[Log2[nn]]]]; f = func[tn]; ], PopupMenu[Dynamic[wave, ...


1

Manipulate[ SeedRandom[seed]; (...), {n, 50, 1000}, {seed, 0, 100, 1}]


1

Simple and elegant Manipulate[ ListPlot[list, PlotRange -> {{0, n}, {0, 1}}], {{n, 10}, 1, 20, 1}, {{list, RandomReal[1, 10]}, ControlType -> None}, Button["Generate", {ngen = n; list = RandomReal[1, ngen]}] ]


1

See DialogInput > Possible Issues as a possible explanation of the freeze issue. It is also a good idea to be aware of PreserveImageOptions which may also disconnect the control from the content. So using the combination PreserveImageOptions->False for ArrayPlot and SynchronousUpdating -> True for Manipulate seems to fix the issue: img = ...


1

The performance issue is that you are dynamically building several levels of tables into tables into a plot function into a manipulate. This is very slow and what you are looking for is to build the table outside the plot and outside the manipulate and only do the indexation inside. However (!!) it seems to me there is a very straightforward solution to ...



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