# All Questions

2k views

### How to make a tight crop of a 3d plot?

I like Mathematica, but it's syntax baffles me. I am trying to figure out how to minimize the whitespace around a graphic. For example, ...
433 views

### Building a tree

Given a list of word characters, such as this one, I'd like to build a tree, similar to this makeTree function, but with the tree in a different format. So, for an input such as ...
272 views

### How to plot a series using different colors depending on the y-value

I have a sequence of numbers ${x_1,x_2,\ldots,x_n}$. I would like to plot the sequence using ListLinePlot but use a different color depending on if the values $x_i$ are within $a_i<x_i<b_i$. ...
169 views

### Show graphics content in front of frame

Consider some graphics which spill over the plot range, like these: ...
74 views

### Using PatternSequence on its own in ReplaceAll?

Say I have this list: list = {0, 1, 2, 0, 1, 3, 0, 1, 4} and say I want to remove consecutive sequences of 0 and 1. I'd normally go for this: ...
1k views

### What is the best distribution for my histogram?

I defined a security bound for a random walk (cube with 15 lengh) and i have this code to obtain a sample of the random times at which the random walk crosses the boundary for the first time: ...
158 views

### How to avoid CopyTensor in CompiledFunctions?

In a reply here Leonid wrote, “Compile can handle a number of higher-level functions, such as Transpose, Partition, Map, MapThread, etc. Most of these functions return expressions, and even though ...
618 views

### Workflow in the Mathematica and Workbench IDE

After visiting one of the Wolfram presentations, I started writing code for my number theory research project in Mathematica because I found it to be faster than Sage. I downloaded Workbench and ...
611 views

### How can I create a fountain effect?

Inspired by this (please use Chrome or Firefox), I tried to simulate it, but I couldn't do it. I'm not familiar with Dynamic. Here is my simple code: ...
177 views

### Vertex merging in graph?

Given a Graph such as the one produced with the following code ...
135 views

### CSS Selectors for Symbolic XML

Symbolic XML is a convenient way of managing XML in Mathematica, at least for casual use or small tasks. Here and elsewhere you can find examples of XML handling in Mathematica, including XSLT/XPath ...
557 views

### How to combine more locations (GPS coordinates inside one city) with Google map?

I have a list of GPS coordinates.E.g. GPSList = {{47.680800, 17.626446}, {47.681078, 17.627283}, {47.682759, 17.631810}}; I would like to crate a Google Map ...
475 views

### 1D quasicrystal: points on a line nearest to points on a lattice

I have a simple lattice / line manipulation: ...
692 views

### Can you apply the Cellular Automata function to a grid containing numbers?

Im attempting to simulate a simple evacuation model using cellular automata theory.My study aims to determine whether Cellular Automata can effectively represent how people would behave in a fire ...
287 views

### Add lines to 3D Plot

How can I add lines that demarcate the different regions of the following 3D plot: Plot3D[1/(1 + E^(-a - c)), {a, -8, 8}, {c, -8, 8}] To give you an idea of what ...
544 views

### High Contrast Syntax-Highlighting

I have a neurological disorder which causes me to have migraines if I look at a white computer screen. To combat this, I have put the following at the top of all of my Mathematica notebooks: ...
207 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: ...
312 views

### How to prevent instability blow up in NDSolve?

I have the following code to solve a PDE: ...
262 views

### How to generate nonperiodic tilings?

I need to generate nonperiodic tilings which are similar to the attached figure (kite-domino tiling). I was thinking the code is similar to the code for the Penrose tiling. However, that code is too ...
2k views

### How to find the Shortest Path, visiting ALL vertices, without coming back to the start (Hamiltonian Path, minimum distance)

A car has to pick up each person and take them to their destination. I am trying to find the shortest tour that will do this. How can I find the shortest path between any s and t.... visiting all ...
5k views

### Does Mathematica implement the fast Fourier transform?

Is there a fast Fourier transform in Mathematica? Although looking in the help I could not find one. I am looking to implement the equivalent of fft in MATLAB.
312 views

### Connect neighbouring points as list of segments in 2 D

Context I am interested in connecting neighboring points in 2/3D as list of segments. I am guessing this is something within the reach of graph theory, which is well implemented in mathematica. ...
464 views

### Building a molecule viewer: aesthetic rotations

I am working on building a molecule viewer in Mathematica and am running in to problems with controlling rotation of the molecule (which is rendered as a ...
597 views

### Export to CSV is very slow - can performance be improved?

I have to provide data exports from Mathematica to CSV format and it is very slow compared to other formats as can be seen in the following table: JSON, 15 sec, 8.4 MB TXT, 23 sec, 5.6 MB XLSX, ...
7k views

### Quick Hessian matrix and gradient calculation?

I am absolutely new to Mathematica and I actually want to try implementing a little optimization method . Long story short assuming I have a predefined two-variable function f(x,y) I want to ...
115 views

### Are there any videos that show how different Mathematica expressions are evaluated?

Are there any videos that show how different Mathematica expressions are represented internally as object graphs and demonstrate how they are transformed during an evaluation? I am asking because I ...
209 views

### How can I create a colour image using raw black and white data? (FITS data cube)

I have a data cube containing pictures of a galaxy across a thousand wavelengths. I want to take the data for the image slides in the red and blue parts of the spectrum, and have them represented in ...
582 views

### Compiling ColorFunction for faster complex phase-amplitude plots

I have gotten into the habit of plotting complex-valued functions on a plane using a color-function along the lines of ...
820 views

### Are there any “RLink” like projects, which enable the interaction between R and Mathematica?

I want to borrow the vast amount of packages of R. I know there was one but it is neither sold nor supported anymore. So are there any active open source projects for linking R with Mathematica? Thank ...
2k views

### Unsaved notebook is crashing: is there any way I can save the state of the MathKernel before I kill it?

So I'm in the middle of generating some plots and all of the sudden the frontend goes dead and I haven't saved my work. I'm using Mathematica 8 in MacOS X. The MathKernel process is still running and ...
715 views

### When to make (file.nb) instead of (file.cdf)?

I started with File > New > FreeCDF so I can save my work in a format compatible with the CDF Player. I can use Mathematica to make new cells, evaluate input and so in the CDF file. What are the ...
978 views

### Graph vs GraphPlot

What is the difference (in purpose) between Graph and GraphPlot? Which function is bested suited to which tasks? Background: I ...
3k views

Since PolarPlot doesn't support Filling, what is the best way to shade or fill the a region between two polar curves? For ...
607 views

### Using Transpose with a list as the second argument

I'm having difficulty understanding the Transpose function. I know what the transpose of a matrix is, not a problem, and I see that applying the ...
1k views

Inspired by the recent question about xkcd styled plots I started looking at xkcd again and I came across a comic titled Click and Drag. And if you do that, you start exploring a larger drawing. A ...
723 views

### How to visualize the voting choices in the moderator elections?

I'm trying to use Mathematica to create some visual representations of the votes cast in the recent Mathematica-StackExchange moderator elections. (Not the vote-counting system itself, OpenSTV, but ...
977 views

### Using the Krylov method for Solve: Speeding up a SparseArray calculation

I'm trying to implement this Total Variation Regularized Numerical Differentiation (TVDiff) code in MMA (which I found through this SO answer): essentially I want to differentiate noisy data. The full ...
659 views

### Change the color of a Locator in a Manipulate

How can I change the color of a Locator in a Manipulate? As an example, consider the following. ...
211 views

### “With” as part of the “Dynamic Interactivity Language”

I noticed that in Mathematica's Function Navigator With is listed as being part of the "Dynamic Interactivity Language". It is not the first (or even the fourth, ...
146 views

Usually h @@@ {f[1, 2], f[3, 4]} === {h[1, 2], h[3, 4]} but this is not the case when f is ...
260 views

### What is the status of ::Usage and Templates in Mathematica v10?

In Mathematica 9, a number of issues concerning the ::Usage and templates were raised. In 9.0, there was a bug first reported here and better diagnosed here, where ...
429 views

### Scaling edge thicknesses

UPDATE There may be some confusion as to the specification of the problem. kguler's answer doesn't really answer the question. I'll try to elaborate a bit at the bottom of the post. One problem ...
349 views

### Are there advantages to using additional arguments of common functions rather than alternative ways of calculating with lists?

(Apologies for the long question title.) One of the interesting, if sometimes confusing, things about Mathematica is that there is always more than one way to do things. Even intermediate users can ...
229 views

### Where is the old option TraceInternal->True?

Already at least in version 2 (I think), the function Solve calls the function Roots. At that time, I had a rather dirty trick, that still works, to verify this: ...
253 views

### How do I get a list of allowed values for an option?

When using Mathematica how can I get a list of the allowed values of an option? As an example I can use the Options command as follows - ...
648 views

### Why are all the lines commented when I create a Mathematica script?

When I created a Mathematica script, I found that all my lines were commented out (when opened with vi or gedit or any other ...
265 views

### What is the most convenient way to change options for Graph[] objects?

What is the most convenient way to change options such as VertexLabels in existing Graph objects? (Version 7 users note: ...
636 views

### Measure a DensityHistogram[] pair similarity

I study human vision and more specifically eye-movements. "If we display 2 symmetrical patterns (20 min one after the other), will our gaze distribution be symmetric is my research question." The 2 ...