# All Questions

5k views

### How to make a 3D globe?

There are many ways to create a 3D Earth that is rotatable (see here, here, related here), but most of them have some drawbacks. These issues mainly stem from either ...
1k views

### How to distribute proprietary Mathematica code

If I want to make package-code completely unreadable, in a way that the end-user can only call my functions, but has no way to re-engineer my definitions, how would I do that? I know I can use ...
1k views

### Compiling more functions that don't call MainEvaluate

I would like to use Compile with functions defined outside Compile. For example if I have the two basic functions F and G F[x_] := x + 2 G[x_] := x And I want ...
3k views

### How to find circular objects in an image?

How could I use morphological processing to find circular objects in an image? More specifically, I need to detect road signs. I need to get the "80 speed limit" sign from this image:
650 views

### Placement of Condition /; expressions

It is my practice to place Condition expressions on the left side of := and :> in almost ...
890 views

### What is the complete list of valid Front End Tokens?

What is the complete list of valid Front End Tokens? Preferably, by version number.
781 views

### Can a Trie be implemented efficiently?

What is the most space and time efficient way to implement a Trie in Mathematica? Will it be practically faster than what is natively available in appropriate cases?
713 views

### Prepend Information to Warning Messages

I have a function running within a Do loop that sometimes issues a warning. I'd like to prepend the warning with the loop ctr so that I can go back and debug that instance later. Basically, I would ...
4k views

### Density plot on the surface of sphere

I would like to make density plots of a list of (size 2 or 3) spherical harmonics on the surface of a sphere. I'd like to plot it so that each element of that list is using a different color (red ...
3k views

### Is it possible to change the color of plot in Show?

For example: p = Plot[Sin[x], {x, 0, 1}] Is it possible to write options in Show to change the curve's color for example into ...
1k views

### “Covering up” text in Graphics

Consider the following code: ...
3k views

### How to create a heatmap from list of coordinates?

I have a list of coordinates in form {{x1,y1},{x2,y2},...} Is there a way in mma to builds density plots based on position ( ...
545 views

### How do I obtain an intersection of two or more list of lists conditioned on the first element of each sub-list?

Given two lists like list1 = {{1, 1}, {2, 4}, {3, 9}, {4, 16}}; list2 = {{2, 6}, {3, 9}, {4, 12}, {5, 15}}; I would like to produce an output like ...
504 views

### Returning an unevaluated expression with values substituted in

Let's say I have a function formula[x_List] := (x[[1]] - x[[2]]) + (x[[3]] - x[[4]]); and I want to pass it a variable and get back the unevaluated formula with ...
2k views

### Can 2D and 3D plots be combined so that the 2D plot is the bottom surface of the 3D plot boundary?

I have a ListlinePlot function, that I would like to combine with both a Graphics3D plot and a ...
377 views

### Custom functions by delegating options in a specific way and using core functions

I'd like to create a custom function that does essentially the same as a core function of mathematica but uses different default settings. Example: I want a Plot function that uses Mathematica's core ...
695 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: ...
2k views

### extract values from replacement list

Solve returns a list of replacement rules In: Solve[x + y == 3 && x - y == 6, {x, y}] Out: {{x -> 9/2, y -> -(3/2)}} I am only interested in the ...
1k views

### First positive root

Simple question but problem with NSolve. I need help how to extract first positive root? For example: ...
7k views

### Creating a table/Matrix during a For loop

I have a For loop (with i as a counter), which calculates different values (y1, ...
1k views

### Select/Delete with Sublist elements?

Probably easy and short question, I still didn't fully figure out how to easily select/delete sublists from a list. Example: tt = {{2, 4}, {4, 8}} I want to delete/select all the elements where ...
933 views

### How Can I use Solve/Reduce Output

Suppose I want x and y to be rationals Solve[ x^2 + y^2 == 1, {x, y}, Rationals] I am ...
260 views

In the ideas shared in my answer to this post Struct equivalent in Mathematica? at the end I propose a solution that changes the way Set works in a particular case that can be expressed in plain words ...
1k views

### RevolutionPlot3D: but NOT revolving about the z axis

I want to demonstrate generating a solid of revolution by revolving a planar region about, say, a horizontal axis. However, RevolutionPlot3D doesn't seem to have an ...
592 views

### Solve an equation in $\mathbb{R}^+$

How can I solve this equation (both numerically and literally) only in the positive reals $\mathbb{R}^+$? Solve[x == (v0 - (A CD t v0^2 ρ)/(4m)) Cos[θ] t, t] And ...
2k views

### The difference between 0. and 0

I have a function for which 0 is a special case: f[A___, 0, B___] := 0 But since I am doing numerics, sometimes in the course ...
2k views

### Fixed color scale in multiple density plots

I think there should be a simple solution for my current problem, but neither StackOverflow (or the help of Mathematica) or Google have it. I have to plot multiple density plots with a color ...
496 views

### Evaluating an If condition to yield True/False

I would like to decide whether an option passed to my custom function has the value Automatic or something else. This is my attempt: ...
337 views

### Help on evaluation control?

I want to plot series of slopes: x, 2x, 3x, 4x, 5x, 6x... I'm trying to do this: ...
232 views

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 ...
6k 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 ...
9k 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 ...
1k views

### Syntax highlighting for your own functions

Mathematica has a useful feature that for functions and special constructs getting passed local variables (for example Minimize or ...
4k views

### How can I generate this “domain coloring” plot?

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. ...
3k views

### Does Mathematica have advanced indexing?

I have two $M \times K$ arrays $L, T$ where I would like to set all the elements in $L$ to zero whenever the corresponding element of $T$ is greater than 15. The ...
1k views

### How to generally match, unify and merge patterns?

This question was split from this one. While that question is now about how to match two particular patterns (mostly using Verbatim or ...
3k views

### How to change the default ColorData used in Mathematica's Plot?

This question leads on from the recent question What are the standard colors for plots in Mathematica? There it was determined that the default color palette used by ...
3k views

### How can I make an X-Y scatter plot with histograms next to the X-Y axes?

I just saw a nice plot there: How could I implement that in Mathematica — by which I mean the plot structure, not so much the styling.
2k views

### How to visualize/edit a big matrix as a table?

Is it possible to visualize/edit a big matrix as a table ? I often end up exporting/copying big tables to Excel for seeing them, but I would prefer to stay in Mathematica and have a similar view as in ...
1k views

### How can all those tiny polygons generated by RegionPlot be joined into a single FilledCurve?

RegionPlot will usually generate a large number of tiny polygons for filling the region: ...
2k views

### Are there any cases when For[] loops are reasonable?

To my mind the only reason for the existence of For[] loops in Mathematica is to allow new users with some experience in procedural programming languages to write ...
2k views

### Simpler input for the new unit support

I've been playing with the new unit support in Mathematica 9. It seems very useful, but the syntax is very verbose. Instead of typing: ...
612 views

### Are there guidelines for avoiding the unpacking of a packed array?

Packed arrays are very useful because they save memory and generally allow speedier and more efficient calculation times. If a list of data currently stored as a packed array is unpacked, it can slow ...
2k views

### Data Table Manipulation in Mathematica

I am a statistician searching for an efficient way to select rows or columns from a table of data in Mathematica. Let me pose the question in 2 parts with a SQL-style table of data: ...
2k views

### How to select minimal subsets?

I am a newbie, so please point me in the right direction if you feel this question has been answered somewhere else before. Here goes: Suppose I have a list like this: ...
1k 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 ...
763 views

### Items known by CurrentValue

CurrentValue can be used to poll the state of numerous system values such as the mouse position. Its help page doesn't list all possible items, though. An item like ...
2k views

### Efficient way to generate random points with a predefined lower bound on their pairwise Euclidean distance

Using Mathematica what is an efficient way to generate a list of $n$ random two dimensional points $\{x_i,y_i\}$ where $i=1,...,n$ so that no two points $p_1$ and $p_2$ in the list has an Euclidean ...