Hot answers tagged

12

I would suggest using the second argument of Dynamic: DynamicModule[{shape = Disk[], targets = RandomPoint[Disk[], 10]}, Panel@Column@{ Item[ RadioButtonBar[Dynamic[ shape, (targets = RandomPoint[#, 10]; shape = #) & ], {Disk[] -> "Disk", Rectangle[] -> "Rectangle"}], Alignment -> Center ], Dynamic@...


10

You are almost there but Graphs are not mutable so: DynamicModule[{graph}, Dynamic[graph] , Initialization :> ( graph = Graph[ {1 -> 3, 2 -> 3, 3 -> 6, 4 -> 6, 1 -> 5, 5 -> 4, 6 -> 2}, VertexLabels -> "Name", VertexShapeFunction -> ( EventHandler[ Disk[#1, .1], "MouseClicked" :> (graph = ...


8

I think this may be the behavior you desire. I am borrowing Kuba's modified ClipPanes specification. One should not need RawBoxes here I think but it does serve the purpose to get our Dynamic expression into the Front End box form. DynamicModule[{vp}, {vp} = Options[Graphics3D, ViewPoint][[All, 2]]; Graphics3D[{FaceForm[Red, Blue], Sphere[]}, Axes ...


4

Your Manipulate expression works for me when I change your button specification to Button["Run", pts = {{0, 0}}; func[], Method -> "Queued"] However, I think it would better to replace your unnecessarily complicated Manipulate expression with a simple DynamicModule expression. DynamicModule[{pts = {{0, 0}}, a = 10, i = 1, func}, func[] := Do[Pause[....


4

ArrayPlot is much more than just a simple array like Grid: it represents a ranged 2D dataset, and its visualization can be finetuned by options like DataReversed and DataRange. These features make it quite complicated to reproduce the same layout and order with Grid. Here I offer AnnotatedArrayPlot which comes in handy when your dataset is more than just a ...


4

Body of Manipulate is effectively wrapped with Dynamic so we can just put it there: Manipulate[ c = If[k == 0, {0, 0}, If[k == 1, {0, 1}, {0, 2}]]; Graphics[{}, PlotRange -> 2, Frame -> True], {{c, {0, 0}}, Locator, Appearance -> Graphics[{Disk[{0, 0}]}, ImageSize -> 10]}, {{k, 0}, {0, 1, 2}}]


4

Example Code DynamicModule[ {k = 0}, Column[{ (*Control*) SetterBar[Dynamic @ k, {0, 1}], (*Visual*) Dynamic @ Graphics[ Switch[k, 0, Locator[{0, 0}], 1, Locator[{0, 1}]], (*Graphics Options*) Axes -> True, PlotRange -> 2 ] }, (*Column Options*) Alignment -> Center] ] Output


3

Skip that and go upvote Mr.Wizard's answer :-) I don't know much about rendering of Graphics3D by FrontEnd, but I'd expect ClipPlanes to accept Dynamic setting. GraphicsBox3D stays the same after changing it so it seems it is a FrontEnd which handles it anyway. It is not the case but we can deal with that problem. we need Dynamic @ Graphics3d we need ...


3

Option 1: Use the UpdateInterval option to Dynamics, i.e., Dynamic[Plot[...],UpdateInterval->n,TrackedSymbols->{}] where n is measure in seconds. Here, UpdateInterval is how often Dynamic "manually" updates the expression. By default it will also update it any time one of the symbols is changed, so you also need to set TrackedSymbols->{}. ...


2

Though similar to @Jess's answer, I think this will work as you want. Dynamic[PLOT,UpdateInterval->10,TrackedSymbols->{}] Because UpdateInterval only set the Max Update interval!! So as your data is updating at a almost crazy speed, the plot will sense the change of your data and update crazily as well. You have to manually tell Dynamic: don't track ...


2

I cannot reproduce the OP's problem, and despite that the variations on David G. Stork's and Chris Degnan fixes are limited and trivial, I will make some comments on potential issues in the code. These issues may in fact be a problem in the OP's notebook (but not in the code per se), which I will explain. The body of a Manipulate is wrapped in Dynamic[] ...


1

Although syntactically correct, your Manipulate expression is somewhat strange. Normally, one does not initialize a control in the first argument of a Manipulate expression, but I know of nothing in the literature of dynamic constructs that forbids it. On the other hand, because the order in which control variables are initialized is not clearly documented ...


1

Try this: Manipulate[ If[set == True, (upper = hig; lower = low), upper = lower = 0)]; tepsr = {1, 2, 3, 4, 5, 6, 7, 8, 9}[[1 + low ;; 9 - hig]]; tepsi = {9, 8, 7, 6, 5, 4, 3, 2, 1}[[1 + low ;; 9 - hig]]; ListLogLinearPlot[{tepsr, tepsi}], {{low, 0}, 0, 3, 1}, {{hig, 0}, 0, 3, 1}, {{set, False}, {False, True}}] Your problem may be due, ...


1

Not really clear what you're trying to do. Maybe this will help though. Manipulate[ tepsr = {1, 2, 3, 4, 5, 6, 7, 8, 9}[[1 + low ;; 9 - hig]]; tepsi = {9, 8, 7, 6, 5, 4, 3, 2, 1}[[1 + low ;; 9 - hig]]; Row[{ListLogLinearPlot[{tepsr, tepsi, epsi}, ImageSize -> 400] , Button["Set", upper = hig; lower = low; epsi = Interpolation[tepsi]]}],...


1

Suppress formatting errors by setting the necessary options for the actual notebook or for the front-end: SetOptions[EvaluationNotebook[], AutoStyleOptions -> { "FormattingErrorStyle" -> {FontColor -> RGBColor[1., 0.33, 0.33], Background -> RGBColor[1., 0.33, 0.33, 0.15]}, "FormattingErrorTooltips" -> False, "...



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