Questions relating to the dynamic family of functions in Mathematica, such as Dynamic, DynamicModule and Manipulate.

learn more… | top users | synonyms

15
votes
5answers
1k views

How are parameters evaluated for a Plot in Manipulate

I am trying to get my head around how Manipulate evaluates functions in a Plot. I have read the introduction to Manipulate, and introduction to Dynamic, but I still ...
94
votes
2answers
9k views

How to manipulate 2D plots?

When it comes to visual analysis, large datasets or data with intricate internal details often makes plotting in 2D useless, as the outcome is either just a fraction of the full dataset, or no details ...
6
votes
2answers
403 views

Programming with Dynamic

I don't understand the following: f[a_, b_] := a + b ls = {1, 2, 3}; MapThread[f, {ls, {10, 20, 30}}] This yields ( as expected ) {11,22,33} If I change ...
12
votes
3answers
563 views

Why do buttons with ChoiceDialog freeze the front end?

Pressing the button below will freeze my front end. An unpainted white dialog box comes up, then it completely freezes, and I need to forcibly kill the front end. CPU usage stays at zero during ...
6
votes
5answers
1k views

sliding a tangent line along a curve

I am confused by Dynamic. I am trying to slide a tangent line along a curve, without using DynamicModule, so that I can include ...
15
votes
2answers
2k views

How to extract the numerical value of a dynamical variable

I want to inspect interactively an image by selecting points by the mouse pointer. This is easily done by LocatorPane - here is a simplified example: ...
28
votes
3answers
2k views

Generating graphs interactively (GUI)

I want to create graphs interactively using a GUI. I thought of using a ClickPane[] environment. The code I have (in part borrowed from the Documentation) works ...
4
votes
3answers
425 views

How can I compare a dynamic variable with a literal in Mathematica?

I'm doing a Mathematica Notebook and I want to make an alarm clock. Something like this: ...
3
votes
1answer
306 views

Initializing Manipulator value within DialogInput (version 10.1 only)

Bug introduced in 10.1.0 and fixed in 10.2.0 I've confirmed, with WRI, that an issue was introduced in version 10.1 with regard to initializing Manipulator Dynamic ...
32
votes
9answers
11k views

How to create animated snowfall?

Well, the title is self-explanatory. What sorts of snowfall can we generate using Mathematica? There are two options I suggest to consider: 1) Continuous GIF animations with smallest possible number ...
40
votes
3answers
6k views

How to create a progress bar?

I would like to create a progress bar tool that allows me to see how my computations are going. I found answers to this question on many sites, I even found a package for it ( ...
15
votes
1answer
445 views

Is it possible to use Begin and End inside a Manipulate?

May be someone can explain why I can't use Begin["context`"] and End[] inside a Manipulate ...
39
votes
3answers
1k views

How can I set up a versioning system within a notebook?

Since the Frontend crashes a lot, for important work it would be nice to have the notebook automatically branch and save itself every so many minutes. For instance, commands like ...
18
votes
4answers
771 views

How can I make an InputField with a proper newline/carriage return?

The return key does not work as expected in an InputField, how can I overcome this?
5
votes
1answer
347 views

Basic question about Dynamic

Please consider the following: ...
139
votes
1answer
25k views

Mathematica Minecraft

Some time ago I asked myself: with all these great graphics and interactive capabilities of Mathematica, what kinds of 3D games can be implemented in it? And the answer which came to mind is ...
27
votes
3answers
1k views

What are the most common (usual) ways to make palettes with non-trivial functionality?

What are the best (most robust and most convenient) ways to create palettes that can be installed permanently (using Palettes -> Install Palette...) and are safe ...
23
votes
4answers
484 views

What is the point of Refresh if Dynamic has an UpdateInterval option?

I haven't found an example where I can't get rid of Refresh[]: ...
15
votes
4answers
700 views

Button evaluation inside DynamicModule

Someone know why this Button works when clicked: ...
11
votes
7answers
996 views

How to dynamically toggle curves on/off in a crowded Plot?

When multiple curves appear in a single plot, it is useful to interactively turn certain curves on or off to visually compare smaller numbers of curves. It is trivial to put a quick dynamic together, ...
12
votes
2answers
633 views

Syntax highlighter shows error for Manipulate when it's inside a Block or a Module

I'm putting my new copy of Mathematica 10 through its paces and I noticed a weird change in the colouring scheme that I find very annoying, and I'd like to get some insight into why it's happening. ...
4
votes
1answer
315 views

Evaluation inside Button stops after some seconds

I would like to trigger a long calculation inside a dynamic module with a Button. It seems that the evaluation stops without an error-message after some seconds. I made a test outside the a dynamic ...
43
votes
2answers
916 views

How safe is the use of Block and Internal`InheritedBlock

For many questions on this site answers are given which suggest to use Block and, especially for more advanced topics, ...
19
votes
1answer
839 views

What is the proper method to load a Mathematica package inside a DynamicModule

I have a DynamicModule that requires loading of Mathematica packages. The usual methods do not seem to apply (...
12
votes
3answers
623 views

How to anchor a Pane's scroll position to the bottom?

Suppose I have a Pane containing some dynamic text, for example that is being updated by a logging function. ...
7
votes
2answers
875 views

Moving From Dynamic Module to Manipulate

In trying to implement Vitaly's suggestion about how to take control of Locator events, I have been able to make headway using ...
6
votes
2answers
410 views

How to dynamically update Locator[] constraints?

I need to visualize Menelaus' theorem for a triangle with moving locators for each of six points. So the vertexes of the triangle can move in any possible way, and the three points on the sides of the ...
13
votes
1answer
454 views

How to create interrelated sliders?

Say I want a slider that controls the value of $x$ and another slider that controls the value of $2x$, how would I go about it?
10
votes
3answers
292 views

Problem with UpdateInterval

I want to monitor current results with Dynamic ...
20
votes
3answers
875 views

LocatorPane and PlotRange

Consider the following snippet from the documentation on LocatorPane ...
21
votes
4answers
579 views

How to Initiate a queued evaluation from a Dynamic GUI without using a Button

I have a Dynamic-based GUI, and one part of it will kick off a calculation that could take longer than the default 5-second dynamic timeout. I know that ...
19
votes
2answers
1k views

Interactively extract points from a plot (ListPlot or SmoothDensityHistogram)

Is there a way to dynamically define a polygon on a plot (I'm working with ListPlot and SmoothDensityHistogram) to select a ...
10
votes
2answers
418 views

How to draw the image of a circle under the action of a transformation of the phase flow?

How to draw the image of a circle $x^2+(y-1)^2<1/4$ under the action of a transformation of the phase flow for the equation $\dot{x}=y,\ \dot{y}=-\sin x$? Here $\dot{x}$ means $dx/dt$. Any help or ...
9
votes
2answers
925 views

How To interactively create a Polygon in a Graphic?

Background: suppose I start with the following (working) snippet. Manipulate[Graphics[Line[{{0, 0}, p}], PlotRange -> 2], {{p, {1, 1}}, Locator}] Ideally, I ...
14
votes
3answers
1k views

Logarithmic slider

Is it possible to create a logarithmic slider similar to this one that responds to a change of the variable value? That is, when the slider is moved, the variable value should update. When the ...
15
votes
2answers
356 views

Rounding problems inside InputField

Consider the following InputField InputField[Dynamic[h2, If[# === Null, h2 = h2, h2 = Round[#, 0.001]] &], Number] The ...
9
votes
5answers
536 views

Manipulate Exp[I θ]+b Exp[-I θ]

I've uploaded an image showing a demonstration I'd like to create, but I definitely need help. There is a lot of talent on this list, so maybe someone can help me get started learning how to add ...
6
votes
1answer
607 views

Enabled option for slider in Manipulate not updating dynamically

In a Manipulate expression I have a slider control which has the Enabled option ...
19
votes
1answer
639 views

How can I effectively performance-profile Dynamics?

How to optimize performance-wise a complex dynamic expression (like a GUI) with lots of dynamically updated components, which require different update-frequencies? I was hesitant to ask this question ...
21
votes
3answers
693 views

Using Refresh[..] with TrackedSymbols

This is a very basic question, but I don't understand the following behavior. The usage to Refresh reads represents an object whose value in a Dynamic should be ...
26
votes
1answer
718 views

How do I find all the possible events that work with EventHandler?

The EventHandler documentation, More Information section, lists 5 mouse events: ...
10
votes
3answers
897 views

What is the right way to construct DynamicModule

When I'm creating DynamicModules for CDF purposes I'm usualy basing on my experience with that, particular goal and content rather than on deep insight. I want to ...
8
votes
2answers
344 views

Palette button with progress bar

Let's say you have a palette with a button that has to do some time-consuming task when clicked: ...
23
votes
2answers
963 views

Why animator smoothes dynamic updates, or how to make pacman drink beer

How could I make a pacman drink beer in Mathematica? This is what I have so far ...
18
votes
1answer
804 views

Module vs DynamicModule for a dynamic variables in a grid. || Spelling Bee

When my daughter asked me help with her spelling homework, for me the obvious thing to do was to write a Mathematica program for it. The words: ...
12
votes
1answer
296 views

How to create a notebook element that can replace itself?

I would like to create a notebook element that can replace itself. Here's an example to illustrate: ...
10
votes
2answers
391 views

Restrict Sensitivity of Locators in LocatorPane

We can restrict the movement of locators in a LocatorPane as follows: In the following example, the first locator's movement is confined to the x-axis and the ...
9
votes
2answers
160 views

Dynamic cells after Kernel restart/quit:

After quitting the kernel only one Dynamic cell fires. And it does not matter how many are there. ...
8
votes
1answer
682 views

Generating dynamic Inputfields

I want to create a bunch of input fields, four in this case, one for each element of the list "x", but since Dynamic has ...
13
votes
1answer
254 views

Why does a variable become real when using the second argument of Dynamic?

Version 9, on Windows 7. Please compare these 2 very simple examples Manipulate[ x, Row[{Manipulator[Dynamic[x], {0, 10, 1/100}]}], {{x, 1}, None} ] and ...