Tag Info

Hot answers tagged

43

For differentiation at least, old versions of Mathematica had a demonstration function called WalkD[] that holds your hand and shows what is done at each stage up until the final answer. In general, however... You should realize at the outset that while knowing about the internals of Mathematica may be of intellectual interest, it is usually much ...


21

Date-picker implementation in Mathematica The following is my implementation of a simple date-picker. The current date is highlighted in LightBlue and the weekends are highlighted in LightGreen. The selected date is always highlighted in LightRed (the default selection is the current date). You can tap into this calendar by using the Dynamic values for ...


16

ListPlot accepts data wrappers besides Tooltip (although I could not find any mention of this feature in the docs). So, @Jens' method can be achieved without post-processing: data = Table[{Sin[n], Sin[2 n]}, {n, 50}]; ListPlot[PopupWindow[Tooltip[#], #] & /@ data] On mouseover: Click on a point: Note: Thought this was a new feature added ...


16

Perhaps there are better ways, but one I am aware of is by using CellEvaluationFunction option for a given cell. Here is code to generate some example cell with the behavior similar to what you presumably desire: CellPrint[ Cell[BoxData[RowBox[{"100", "!"}]], "Input", CellEvaluationFunction -> (Module[{res = ChoiceDialog["Evaluate this ...


12

This? {Slider[Dynamic[x], {0, 10}], Slider[Dynamic[2 x, Set[x, #/2] &], {0, 20}]} The documentation explains, under More Information, that "Dynamic[expr,f] makes interactive operations not change expr except by virtue of the evaluation of f[val,expr]. ". Otherwise, Mathematica attempts to assign a value to 2x.


10

To see the steps for taking indefinite integrals one can use free rule-based integrator nicknamed Rubi crafted by Albert D. Rich: Click on the sample integration problem at the end of the notebook and press Shift-Enter to evaluate it. After a minute or so depending on the speed of your computer, the first step of the integration should be ...


10

here is a function based on WolframAlpha[] ShowSteps[exp_] := WolframAlpha[ ToString@HoldForm@InputForm@exp, {{"Input", 2}, "Content"}, PodStates -> {"Input__Show steps"}] SetAttributes[ShowSteps, HoldAllComplete] for limits use PodStates -> {"Limit__Show steps"} for integration PodStates -> {"IndefiniteIntegral__Show steps"} ...


9

I haven't tried it myself but you can install the LiveWeb plugin for PowerPoint which allows to embed a live webpage into a slide. Now you should prepare an HTML page with emdedded CDF object (here you can find old instructions how to do this, but probably there is easier way now) and embed it into a PowerPoint slide. People say that it works surprisingly ...


8

That is the default (and expected) behaviour of LocatorPane. This is useful in implementing things like colour pickers, for example, where it is convenient to simply click on any point to select that colour and have the locator move there automatically to indicate selection. To create locators that move only when explicitly clicked and dragged, use a ...


8

For similar purposes using Button can be useful (in a non-sequential way): images = ExampleData["TestImage"][[1 ;; 8]]; choice = ExampleData /@ images; mods = ImageEffect[#, {"MotionBlur", 15}] & /@ choice; buttons = Button[Grid[{{"Export: " <> #[[1]]}, {Tooltip[#[[2]], HoldForm[Export @@ #]]}}], Export @@ #] & /@ ...


8

The answer by Mr. Wizard covers the built-in options, but one thing that you may be missing is that the tooltip alone isn't very convenient when it comes to recording the desired coordinates for later use. You'd have to read off the numbers and type them in again. If you want to automate this process too, then you might be interested in the following: data ...


7

Inspired by Jens' answer, here is a method that will print below the plot the coordinates of each point clicked. printTip = Button[Tooltip@##, SelectionMove[ButtonNotebook[], After, Cell]; NotebookWrite[ButtonNotebook[], ToBoxes@#2], Appearance -> "Frameless"] &; data = N @ Table[{Sin[n], Sin[2 n]}, {n, 50}]; ListPlot[Tooltip @ ...


7

You could do something like this DynamicModule[{range, ref, range0, fac = 2/3}, range = range0 = 2 {{-1, 1}, {-1, 1}}; EventHandler[ Dynamic@Graphics[{Disk[]}, Axes -> True, PlotRange -> range], {"MouseDown" :> (ref = MousePosition["GraphicsImageScaled"]; range0 = range), "MouseDragged" :> (range = range0 + (ref - ...


7

You can't. You can combine CDFs and content generated by other tools on web pages, though. From Frequently Asked Questions about the Computable Document Format (CDF) (Wolfram Research): Do CDFs plug in to Microsoft Office documents or PDFs? Currently, the CDF Player plugin only supports web browsers. We are exploring the same capabilities for a ...


6

Wrap the output of the CDF (the Plot command in your case) into Deploy, or add the Deployed -> True option to your Manipulate. Using the Deployed option however does not solve all the problems. The documentation states, that Deployed -> True disables: ...general editing and selection in a cell General editing/selection means that in the ...


6

I expanded the answer by @Leonid to restore the previous result if you cancel the evaluation and packaged the functionality into a cell style in my stylesheet for convenience. The cell expression for the stylesheet is pasted below. This works in the cases I use often, but it has not been extensively tested. For example, it will not restore output in cases ...


6

A simple way to do this is to change the Dynamic so that it updates only the points you want to be editable. Here is a very simple demonstration pts = {{6, 0}, {0, 9}, {3, 0}, {0, 7}}; updatable = Range@Length@pts; Button["Fixate point 3", (updatable = {1, 2, 4})] LocatorPane[Dynamic[pts, (pts[[updatable]] = #[[updatable]]) &], ...


6

This is a basic code to get textures and "click on any face to show message" features: Graphics3D[{ {Texture[ExampleData[{"ColorTexture", "Metal4"}]], PopupWindow[ Polygon[{{-1, -1, 0}, {1, -1, 0}, {1, 1, 0}, {-1, 1, 0}}, VertexTextureCoordinates -> {{0, 0}, {1, 0}, {1, 1}, {0, 1}}], Style["metallic floor", 18]]}, ...


5

Build in interface Undocumented and I don't know how to fully customize it but it seems it is something you're looking for: TableView[RandomChoice[{0, 1}, {10, 10}]] rubenko deliverd it here with a link to some info. As Jens have noticed it is not so great but You have to judge it by yourself. Custom interface If you do not need to have fully ...


5

Here is one that should work in version 6 and later. The full code is at bottom. Here is what it looks like: {dateSetter[Dynamic[d]],Dynamic[d]} I did not incorporate the year here, but you could put it in a Tooltip or add it to the button's graphic. And when you click on the button you get Incorporate this into a Manipulate using ...


5

Since it appears that you wish to use live input for your Timeline, webMathematica will be the best solution. CDF cannot accept anything but input from what is in the file itself. Documentation can be found here: http://www.wolfram.com/products/webmathematica/ User Guide is located here: ...


5

Following suggestions in the comments, here is a way to achieve what I want: Manipulate[ Row[{ Plot[Sin[x (1 + a x)], {x, 0, 6}], Plot[Evaluate@D[Sin[x (1 + a x)], x], {x, 0, 6}]}, BaseStyle -> ImageSizeMultipliers -> 2/3], {a, 0, 2, Grid[{{ Slider[##, Appearance -> Tiny], InputField[#, FieldSize -> ...


4

It looks like ArrayPlot is a good approach. I found it a bit faster (especially for a larger splash width) to create the splash up front as a packed array and use RotateRight to move it around. I have also switched off SynchronousUpdating for the graphics, so IC can update more smoothly. L=100; ...


4

Try Column[ {Row[{InputField[Dynamic[x]], InputField[Dynamic[y]]}], RadioButtonBar[ Dynamic[op], {Times -> "Multiply Numbers", Plus -> "Add Numbers"}], Dynamic@op[x, y] } ] Notice how code and data are the same thing in Mathematica, so I can use the fact that the operators Plus and Times can be stored in variables to construct the ...


4

Manipulate[x = ConstantArray[0, 9 {1, 1}]; Row[{EventHandler[Dynamic[tds = Reverse[Transpose[x]]; MatrixPlot[tds, PlotRangePadding -> 0, Mesh -> All, ImageSize -> {300, 300}, ColorRules -> {1 -> Black, 0 -> None}]], {"MouseClicked" :> (pos = Ceiling[MousePosition["Graphics"]]; x = ...


4

A simple suggestion to get you started: have a look at the various videos on the Wolfram website. Here's a good place to start - look at the Experts Live section, for example. Because, no matter how much code you read, and documentation you study, there's nothing quite like seeing people type Mathematica code live in front of you. OK, these folks are ...


4

A fairly crude way to do this is to use e.g. DialogInput or friends, but then you have to intersperse your code with a lot of unnecessary lines: f[x_Integer] := Module[{y, z, r}, y = 5; DialogInput["Proceed with z = 10;\n{y,z,r} = " <> ToString@{y, z, r}]; z = 10; DialogInput["Proceed with r = x + y + z;\n{y,z,r} = " <> ToString@{y, z, ...


4

This colors based upon a divisibility criteria: DynamicModule[{x = 11}, Grid@Map[Button[ToString@#, x = #, Background -> Dynamic[If[Divisible[#, x], Green, Red]], ImageSize -> 30] &, RandomInteger[{1, 10}, {5, 5}], {2}]] Edit If you want it less "buttonlike" and more "gridlike": DynamicModule[{x = 11}, ...


3

I believe you need Deploy to keep the Row elements from being selectable. Here in version 7 compatible format: Module[{opts}, opts = {FieldSize -> 10, Appearance -> Framed}; Row[{ InputField["", String, opts], InputField["", String, opts], InputField["", String, opts] }] // Deploy ]



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