# Tag Info

## Hot answers tagged manipulate

38

I feel that once you start with Moire patterns, there's no ending. The way I would replicate these is by making a grid into a function (like @JasonB) but also parametrise the angle of rotation into it: lines[t_, n_] := Line /@ ({RotationMatrix[t].# & /@ {{-1, #}, {1, #}}, RotationMatrix[t].# & /@ {{#, -1}, {#, 1}}} & /@ Range[-...

28

Since you want the animation to have explanatory content, I thought it might be best to incorporate the explanatory 2D diagram into the 3D scene. So I imagine the 2D plot as a "sticker" that can be put onto the cylinder, like a label on a bottle. That way, you can see the explanatory diagram itself wrap around the cylinder and become identical to the ...

24

A reliable composition of elements Perhaps something like this? (Edit: Fixed to work with Autorun.) Note that the InputField label is editable, similar to a normal Manipulator. One can also add an additional InputField[Dynamic @ x] if a regular InputField is desired. Manipulate[ x, {{x, 1.}, 1., 100., Row[{Slider[Dynamic[Log10[#], (x = 10^#) &], ...

24

Something like this: nlines = 30; Table[ Overlay[ Rotate[ Graphics[{ Table[{ Line[{{0, n}, {nlines, n}}], Line[{{n, 0}, {n, nlines}}]}, {n, 0, nlines}], Text[Style[#1, 18], {0, 0}, {-1, -1}, Background -> White] }, AspectRatio -> 1, PlotRangePadding -> None, ImageSize -> ...

24

This question is too interesting to resist, so I'll talk about how to analyze the problem. Take a look at sketch above. It describes an arbitrary moment during the rolling. From the kinematics view, $P$ is the "instant center of rotation". From the energy view, the square's center of mass $O$ keeps its height, thus the potential of the square doesn't change,...

20

The separation-of-variables solution you quoted has two indices appearing in it: n and j (the subscripts of the coefficient $A_{nj}$). Here, n is azimuthal mode order, i.e. it counts the number of nodes along the direction in which the polar-angle $\theta$ varies (divided by 2). The index j is needed because the wave is supposed to satisfy the boundary ...

20

Quick&Dirty: pt = {0, 0}; full = MandelbrotSetPlot[]; r = 0.2; Column[{ Row[{"Zoom: ", Slider[Dynamic[r], {0.01, 1}]}], Row[ { LocatorPane[Dynamic[pt], Dynamic[Show[full, Graphics[{EdgeForm[Red], Transparent, Rectangle[pt + r, pt - r]}], ImageSize -> Scaled[.45]]]], Dynamic[ MandelbrotSetPlot[{pt + r, ...

19

To prevent shaking, try to add ImagePadding and for the other issue, you can fix the vertical plot range. mpl = Table[ Plot3D[myfun[x, y, t], {x, 0, L}, {y, 0, L}, PlotRange -> {Automatic, Automatic, {0, 6}}, PlotPoints -> 40, ImageSize -> 400, PlotLabel -> Style["t = " <> ToString[t], Bold, 18], ImagePadding -> ...

18

You can use FoldList to generate evolution of your system. You need a function that propagates your particles in time. Every time you apply your function to state at time $t$ you obtain your state at time $t+dt$. Let's make such function for one particle in 1D. Tr1D[{x_, v_}, dt_, L_] := Module[{u, w}, u = x + v dt; {u, w} = If[u < L, {u, v}, {L - (...

18

Block[ { graph = RandomGraph[{20, 100}] , start , path }, start = RandomChoice[VertexList[graph]]; path = NestList[RandomChoice[AdjacencyList[graph, #]] &, start, 5]; ListAnimate[ Table[ Graph[graph , VertexStyle -> {v -> Red} , VertexSize -> Large ] , {v, path} ]]] Block[ { graph = GridGraph[{6, 6}] , ...

17

There are various viewers available that could used to switch between different arrangements of controls. For a seamless look, one might use PaneSelector. If type is to have its own control, putting it inside each of the panes ensures Manipulate will align them. Manipulate[ {x, yyy}, {{x, a}, {a, b, c, d}, None}, {{yyy, 0.5}, 0, 1, None}, {{type, 1}, ...

17

Your average Manipulate has the "Inital settings" button (which is just another bookmark): Another straightforward way would be a simple button to set certain values: Manipulate[x, {{x, 5}, 0, 10}, Button["Reset", x = 5]] which (as pointed out in the comments) allows for unlimited styling, for good or bad: Manipulate[x, {{x, 5}, 0, 10}, Button[...

17

Since you already have an answer for the resizable part I will use a fixed chess board. In fact I replicated the graphics in the Wikipedia article for the eight queens problem a while back, and solved it, so I'll just share my solution. I guess the task left is to 1) Replace my solution with yours and 2) adapt the graphics to the n-queens problems. dark = ...

16

As I understand it, you'd like to dynamically illustrate how the chaos game works by showing how the points arise randomly. Here are two approaches, with enough code in common that we can practically do them both at once. Using Dynamic First, I think it's quite natural to do this with Dynamic. To do so, we set up an image called dynamicPic that we'll ...

16

Manipulate[u, {u, 0, 1}, FrameLabel -> "FrameLabel"] or Manipulate[u, {u, 0, 1}, FrameLabel -> {{"FrameLabel 1", "FrameLabel 2"}, {"FrameLabel 3", "FrameLabel 4"}}] or Labeled[Manipulate[u, {u, 0, 1}], "Label"] or Manipulate[u, Style["Label", 12, Bold], {u, 0, 1}] or Panel[Manipulate[ Panel[u, "Label 1", FrameMargins -> ...

15

Just another way, using built-in functionality ResetButton: Manipulate[x, {{x, 5}, 0, 10}, AppearanceElements -> "ResetButton"]

15

I was hesitating but it seems some people find this information useful. SetOptions[Manipulator, Appearance -> "Labeled"]; Manipulate[{a, b, c}, {a, 1, 10}, {b, 1, 10}, {c, 1, 10}] But, still, I do not consider it the full answer. Like it is stated, it affects only Manipulator, the default control used by Manipulate for domains that are suited ...

15

I've got a package that makes dealing with iterated function systems pretty easy. You can download it off of my webspace. That package implements both deterministic and stochastic alorithms to generate images of self-affine sets like the Barnesly fern Also, I think we can use a better initial shape than an oval. Let's use the functions of the IFS to obtain ...

15

Here's a starting point for you: With[{n = 6}, Graphics[MapIndexed[{ColorData[103] @@ #2, #1} &, NestList[MapAt[Composition[ TranslationTransform[AngleVector[2 π/5]/ GoldenRatio], ...

14

Update 2: Using DynamicSetting to turn Manipulate into an input expression to print snapshots: ClearAll[x, y, u, z, a, t, plot, manipulate] manipulate = Manipulate[Module[{a = {{2, 3}, {3, 2}}, vp}, vp = VectorPlot[a.{x, y}, {x, -4, 4}, {y, -4, 4}, VectorScale -> {0.045, 0.9, None}, VectorPoints -> 16]; z = NDSolveValue[Thread[{x'[t], ...

14

You can do this outside of the manipulate box and show the variable's value as a legend. Also by using fixed image sizes and aspect ratios you can minimize the occurrence of black bars as the variables change. First Step: Make a table of your desired Plots, I think the code here is relatively easy to understand: Anim = Table[ Plot[Sin[x], {x, 0, t}, ...

14

After playing with the variables in a Manipulate I came up with these numbers for the arguments of the AffineMap functions. They aren't perfect. I recommend tuning them yourself: (* Activate Roman Maeder's Code first!* ) (fract2[x_, n_] := Show[Graphics[Nest[IFS[{ AffineMap[0 °, 0 °, 0, 0, 0.18, 0], AffineMap[-2.5 °, -2.5 °, 0.90, 0....

14

Related: 14556 and 7547 Using Locator to give you the control you are seeking : Manipulate[ Plot[Sin[a*x] - .3, {x, -3, 3}, Epilog -> {Dynamic[If[t, Locator[Dynamic[pt], Framed[Pane[ "I want the user to have the abilty to move this box \ anywhere inside this white area so the user can see what's behind \ it.", 70], ...

13

This seems to be a very easy way to bite yourself in the foot (non-flexible programmers this is not for you). I also have the habit of doing those blocked set-based definitions. It's probably time to change the habit now. It seems to me that SaveDefinition extracts the definitions of the symbols required by the Manipulate, as you entered them. If you used :=...

13

Here's a fairly simple way to fix your Manipulate by applying Dynamic to ListPlot. Manipulate[ (* Beep[]; *) data = function @ Range[-Pi*10., Pi*10, Pi/1000]; Dynamic @ ListPlot[data, PlotRange -> {{start, stop}, Automatic}], {function, {Sin, Cos, Tan}}, {start, 1, Length[data]}, {{stop, 300}, 1, Length[data]}, {data, ControlType -> None}] ...

13

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

13

Firstly I'm not sure if Mathematica's Random Tree method has an equivalent max_depth option (I don't know too much about random tree). The options available to the Random Tree method are: "TreeNumber", "LeafSize", and "VariableSampleSize". Now as for plotting the classifier boundaries, one can simply pass the ClassifierFunction for ContourPlot (or similar)....

13

I like to keep things simple, so I'll skip the letter labels, but include the lines overhanging from the grid: m = 30 (* number of mesh lines *); h = 2 (* overhang *); lins = Join[#, Map[Reverse, #, {2}]] & @ Outer[{##} &, ArrayPad[Range[-1, 1, 2/m], h, "Extrapolated"], {-1, 1}]; Table[Graphics[{AbsoluteThickness[1/100], ...

12

The control variable must appear in the Manipulate expression to be tracked. In this case it is e Make expr a true function which is done by passing it all the arguments it needs, and then call it from inside Manipulate expression: expr[e_, x_] := x^e; Manipulate[Plot[expr[e, x], {x, 0, 4}], {e, 1, 3}] Now you can use your function outside of Manipulate, ...

12

So you guys know - quasicrystals are cool structures that can consist of finite number of parts which can be arranged in never repeating - aperiodic - pattern. Thing here is called projection method from a regular lattice. http://www.nature.com/nmat/journal/v3/n11/fig_tab/nmat1244_F3.html Interestingly if you know Fibonacci rabbits problem - that is also ...

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