# All Questions

169k views

### xkcd-style graphs

I received an email to which I wanted to respond with a xkcd-style graph, but I couldn't manage it. Everything I drew looked perfect, and I don't have enough command over ...
95k views

### Where can I find examples of good Mathematica programming practice?

I consider myself a pretty good Mathematica programmer, but I'm always looking out for ways to either improve my way of doing things in Mathematica, or to see if there's something nifty that I haven't ...
51k views

### What are the most common pitfalls awaiting new users?

As you may already know, Mathematica is a wonderful piece of software. However, it has a few characteristics that tend to confuse new (and sometimes not-so-new) users. That can be clearly seen from ...
118k views

### How do I draw a pair of buttocks?

I'm trying to develop a function which 3D plot would have a buttocks like shape. Several days of searching the web and a dozen my of own attempts to solve the issue have brought nothing but two ...
38k views

### Help find a bright object on Mars!

In today's news, scientists found a bright object on one of Curiosity's photos (it's near the bottom of the picture below). It's a bit tricky to find - I actually spent quite some time staring at the ...
58k views

### QR Code in shopping cart handle

This week, the market people from my work wanted to put QR codes in shopping cart handles, but when they tested it, the QR code did not work. I noted that the cylindrical curvature (even small) ...
7k views

### What are the use cases for different scoping constructs?

Mathematica includes three functions that I know of which can be used to effectively (if not actually) define a variable and give it a value within a local scope: ...
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 ...
25k views

### Alternatives to procedural loops and iterating over lists in Mathematica

While there are some cases where a For loop might be reasonable, it's a general mantra – one I subscribe to myself – that "if you are using a ...
6k views

### What is the distinction between DownValues, UpValues, SubValues, and OwnValues?

When reading through the documentation, you often encounter the phrases DownValues, UpValues, ...
10k views

### Are you interested in purchasing David Wagner's “Power programming with Mathematica”?

I recently contacted McGraw-Hill to see if they have a mechanism in place for printing out-of-print books that are still of interest. Specifically, I asked about "Power programming with Mathematica" ...
8k views

### Performance tuning in Mathematica?

What performance tuning tricks do you use to make a Mathematica application faster? MATLAB has an amazing profiler, but from what I can tell, Mathematica has no similar functionality.
18k views

### How to create word clouds?

Word clouds are rather useless fancy and visually appealing plots, where words are plotted with different sizes according to their frequency in a corpus. Many applications exist out there (Wordle, ...
5k views

### How can one find undocumented options or option values in Mathematica?

Mathematica has a lot of undocumented or poorly documented options. How does one go about working out if there is an undocumented option that might solve a particular problem? How does one work out ...
11k views

### How to compile effectively?

What are the best practices of compiling functions? I understand that this is a vague question, but let me list some aspects that might trigger useful answers. Some of these have already been answered ...
5k views

### Implementing efficient multiple undo

At the time this question was asked, version 10 was not out yet. The Front End of Mathematica 10 does have multiple undo, see the answer by John Fultz. The Mathematica Front End's built-in Undo ...
10k views

### List of compilable functions

Is there somewhere a list on the functions that Compile can compile, or the cases in which a particular function can be compiled that I haven't found? I'd be glad ...
20k views

### How to generate a random snowflake

'Tis the season... And it's about time I posed my first question on Mathematica Stack Exchange. So, here's an holiday quest for you Graphics (and P-Chem?) gurus. What is your best code for generating ...
6k views

### How to make use of Associations?

I have been curious about it for long. Now that Mathematica 10 arrives, I think it's time to ask the question: How the new Association data structure would be used ...
6k views

### What are some useful, undocumented Mathematica functions?

There have already been some questions about some undocumented functionality in Mathematica. Such as (please add to these lists!) How can one find undocumented options or option values in ...
34k views

### Elegant operations on matrix rows and columns

Question The Mathematica tutorial has a section 'Basic Matrix Operations', describing operations like transpose, inverse and determinant. These operations all work on entire matrices. I am missing a ...
10k views

### Resources for beautiful Mathematica Stylesheets

When the Wolfram Demonstrations were introduced and the Documentation-Center was redesigned, I remember it was the first time I thought someone had put some effort into creating a beautiful ...
5k views

### Can one identify the design patterns of Mathematica?

... or are they unnecessary in such a high-level language? I've been thinking about programming style, coding standards and the like quite a bit lately, the result of my current work on a mixed ...
25k views

### 1 Plot, 2 Scale/Axis

I would like to plot those two datasets on top of each other. But they have very different range on the $y$ axis. How can I have two different axis? I found the following on the help menu but quite ...
8k views

### Generating visually pleasing circle packs

EDIT: (my conclusion and thank you note) I want to thank you all guys for this unexpected intellectual and artistic journey. Hope you had fun and enjoyed it the same as I did. I would like to ...
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 ...
5k views

### File-backed lists/variables for handling large data

Background Currently I am working with some large data (most of it generated by Mathematica itself). I usually find it a hassle to do this. For example, I just exported a large amount of data to ...
4k views

### Programmatic formatting for Mathematica code - possible?

It seems to be both an interesting programming challenge and a very useful practical application to have a Mathematica program which would allow one to pretty-print Mathematica code, so that it is ...
9k views

### Struct equivalent in Mathematica?

I really miss having something like a struct in Mathematica. I know of (and regularly use) a couple of programming techniques which feel like a ...
1k views

### Why are numeric division and subtraction not handled better in Mathematica?

There is something that has been troubling me for a while. At least through version 10.0 the performance of a / b and a - b is ...
5k views

### General strategies to write big code in Mathematica?

I think after six months of exposure to Mathematica and the Wolfram Language I am fairly OK with writing short codes and snippets. However, what are some general strategies to use in order to write ...
18k views

### $\LaTeX$ and Mathematica

I quite often would like to draw graphics in my $\LaTeX$ documents using Mathematica. I have encountered three problems. I would like to know if there are any workarounds to these problems I would ...
7k views

### Minimal effort method for integrating C++ functions into Mathematica

As of Mathematica 8, what is the minimal effort way to integrate an existing C++ function into Mathematica? I think we have these: MathLink (it was quite long ago I used it last time) communication ...
66k views

### Get a “step-by-step” evaluation in Mathematica

Is it possible in Mathematica to get a step-by-step evaluation of some functions; that's to say, outputting not only the result but all the stages that have led to it? If so, how does one do it? ...
17k views

### Exporting graphics to PDF - huge file

I want to draw some basic surfaces, export them to PDF and include them in a LaTeX file. I create a simple 3D graphics object, for instance with ...
7k views

### How to peel the labels from marmalade jars using Mathematica?

How can I detect and peel the label from the jar below (POV, cylinder radius, jar contents are all unknown) to get something like this, which is the original label before it was stuck on the jar? ...
3k views

### Functional style using lazy lists?

Let's say I want to answer the question "what are the first 400 palindromic prime numbers?" The first approach that comes to my mind from the set of languages that I know is to use some sort of lazy ...
7k views

### Artistic image vectorization

The question is how can we use Mathematica to create vectorized versions of low-resolution images? The goal is to get an image suitable for quality printing at any resolution. Since "true" ...
14k views

### How to make an inkblot?

How to effectively create a polygon that looks like a realistic inkblot? So far, I could come up with this (borrowing from Ed Pegg Jr.'s Rorschach demonstration): ...
5k views

### Functions with Options

Suppose you want to create a function which has optional arguments. Maeder's book "Programming in Mathematica" covers the topic extensively up to version 3, but some things have changed/evolved since ...
8k views

### Recovering data points from an image

Unfortunately, some data can only be obtained in picture form (Japanese publications anyone?). Since this cannot be worked with, it has to be converted to a dataset that can; I was wondering whether ...
3k views

### Open-source IntelliJ IDEA plugin to support Mathematica development

Although we already had a question asking for development alternatives to Wolfram Workbench, I want to ask a more specific question: One of the most advanced IDE's especially for Java programming ...
15k views

### Is there an open source implementation of Mathematica-the-language?

I've seen questions before such as "What is the best open-source equivalent for Mathematica?", but that specific question (and that line of inquiry in general) cares more about the computer algebra ...
10k views

### Creating Mathematica packages

I'm building a package to help me write packages and their documentation. In this post I explained how to make a package and its documentation. In the answer I provided I describe how to build a very ...
3k views

### What is a Mathematica packed array?

A simple sounding question with a few sub questions: What is the difference between unpacked vs packed array? Are packed arrays more space efficent, how much so? Are packed arrays more time ...
5k views

### Shaving the last 50 ms off NMinimize

The epilogue: A paper where the below answer is used was published. The answer below is cited among the references:) The background: I have to fit an objective function for ~10 000 datasets in near ...
3k views

### Flatten command: matrix as second argument

One thing I could never wrap my head around is how Flatten works when provided with a matrix as the second argument, and the Mathematica help isn't particularly ...
2k views

### Automatically generating a dependency graph of an arbitrary Mathematica function?

Has anyone written a function to pull the function dependencies of a function? That is, it would be nice to have a function that returns a list of function dependencies as a set of rules, terminating ...
I found this plot on Wikipedia: Domain coloring of $\sin(z)$ over $(-\pi,\pi)$ on $x$ and $y$ axes. Brightness indicates absolute magnitude, saturation represents imaginary and real magnitude. ...