Questions on creating visualizations from functions or data using high-level constructors such as Plot, ListPlot, Histogram, etc.
376
votes
6answers
142k 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 Plot Legends to have these ...
58
votes
4answers
6k 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 ...
48
votes
2answers
2k 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 ...
41
votes
4answers
2k views
ListPlot: Plotting large data fast
Mathematica produces fantastic-looking graphics, but it can be slow on large data sets. Here is an example for a (random) time series:
...
36
votes
4answers
2k 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.
...
33
votes
4answers
5k views
Creating legends for plots with multiple lines?
So I have a graph with multiple lists, for e.g.
data = {{1,2}, {3,4}, {3,5}, {2,3} . . .}
If I then do ...
33
votes
4answers
2k 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 ...
31
votes
1answer
702 views
Constructing election cartograms?
I found this pretty neat page showing cartograms for the US elections and I don't really know how to get started doing these graphics in Mathematica. For those who don't know, a cartogram is a map in ...
30
votes
4answers
818 views
How to visualize 3D fit
I have a data set of x,y,z values and I fit a function of x,y to the data. This works, but I can't come up with a nice way to ...
27
votes
4answers
689 views
27
votes
3answers
379 views
No warning when extrapolating with Plot
One of the most annoying "features" of Mathematica is that the Plot family does extrapolation on InterpolatingFunctions without ...
26
votes
4answers
1k views
Is it possible to speed up ContourPlot on multi-core machines?
It is not very difficult to face a function for which ContourPlot works too slow. And it seems natural that this function can be parallelized well. Anyway, naive ...
26
votes
4answers
1k 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 ...
26
votes
1answer
807 views
Mathematica2tikz an equivalent function
Matlab2tikz is script which generates native Latex/Tikz figures from MATLAB.
I am looking for an equivalent method/function in Mathematica to generate similar results.
Obviously the final script may ...
25
votes
3answers
900 views
xkcdConvert routines perform slower in Mathematica 9
I am experiencing some rather large performance decreases in Mathematica version 9.0 using the xkcd-styled plotting routines.
I had used the xkcdConvert code ...
24
votes
3answers
429 views
How can I make points “glow”?
I have a set of points in the plane which I would like to have "glow". I would like for each point to glow individually and I would also like some increase in the intensity corresponding to an ...
24
votes
2answers
665 views
Specific initial sample points for 3D plots
PlotPoints lets you determine how many sample points you want in each direction, but sometimes I want specific ones.
For Plot ...
23
votes
4answers
2k 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.
23
votes
4answers
1k views
Need general assistance with plotting lat/long values
I'm attempting for the first time to create a map within Mathematica. In particular, I would like to take an output of points and plot them according to their lat/long values over a geographic map. I ...
22
votes
8answers
887 views
Can I make a plot with gradient filling?
Bloomberg has a standard plot style for its line plots in which it uses a gradient filling. Actually the way this seems to be constructed is that a gradient from the ymax to ymin is used as the ...
22
votes
6answers
5k views
Labeling individual curves in Mathematica
I need to create a plot for export and inclusion in a report. Is there a better way to label curves than PlotLegends? From what I've read and my personal ...
22
votes
1answer
325 views
Creating a package of special plots
In my work as a math teacher, I create lots of graphs to illustrate ideas.
I have lots of math books and will often try to duplicate a particular style of graph.
Below, one very simple example, ...
21
votes
5answers
850 views
Extruding along a path
I'm trying to render a 3D image of a path by extruding a circular cross-section along the path, creating a "snake-like" path.
Here is an image I found to illustrate:
I can't seem to figure out if ...
21
votes
4answers
1k 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 ...
21
votes
2answers
1k views
Plotting implicitly-defined space curves
It is known that space curves can either be defined parametrically,
$$\begin{align*}x&=f(t)\\y&=g(t)\\z&=h(t)\end{align*}$$
or as the intersection of two surfaces,
...
21
votes
3answers
666 views
Difference in Plot when using Evaluate vs when not using Evaluate
This example comes from
the Mathematica documentation for Plot
under Basic Examples.
Can someone please explain why these are each plotted as a different color in ...
21
votes
3answers
2k views
ListPlot with each point a different color and a legend bar
I would like to generate a ListPlot with the color for each point in the plot corresponding to a particular value (not associated with the position in the plot). I'd then like to add a legend ...
21
votes
3answers
449 views
How can the opacity of a dense data set be automatically chosen?
The problem
In a dense data set plotted with opaque points, data points can pile on top of each other. This can cause serious problems with the interpretation of the plots. I'll use as an example a ...
21
votes
4answers
983 views
Saner alternative to ContourPlot fill
I am producing a large number of ContourPlot objects, which when exported generate notoriously large PDF files because it basically generates lots of little ...
21
votes
3answers
401 views
Consistent Plot Styles across multiple MMA files and data sets
I am starting to write a thesis for which I want to use MMA for all my plotting needs, mostly because a lot of the basic analysis has been done there. To ensure that I am applying styles consistently ...
21
votes
2answers
438 views
Aligning plot axes in a graphics object
I need to align the y-axes in the plots below. I think I'm going to have to do some rasterizing and searching for vertical lines, then vary x and ...
20
votes
7answers
567 views
Graphical representation of a moving sound source
Some explanation since I have got a specific and another more open-ended question:
I used two microphones in a 90° arrangement (see picture below) to capture sound from a source moving around the room ...
20
votes
2answers
736 views
Plotting an Unreasonable Function
Without getting into too much detail, the following (very complicated) function recently appeared as a solution to a combinatorics problem I've been thinking about:
$$P(n) = \frac{52!}{52^{52}} \cdot ...
19
votes
7answers
1k views
Changing the background color of a framed plot
I frequently generate framed plots like this:
Plot[Sin[x], {x, 0, 2 \[Pi]}, Frame -> True]
Is there an easy way to change the background color of the framed ...
19
votes
3answers
2k 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 (
...
19
votes
5answers
554 views
How can I make a 2D line plot with a drop shadow under the line?
You often see plots styled like this (ignore the bar chart component):
i.e. with a small drop shadow under the line. (I'm assuming Excel is being used to produce these plots).
How could you make ...
19
votes
3answers
2k views
ShowLegend values
How do I get ShowLegend to put the max and min values that a plot produces.
for example, when using ListDensityPlot, with ...
19
votes
2answers
365 views
Is there a way to have Plot draw points on a function where the function is undefined as circles as in textbooks?
A very common feature of graphs of functions used throughout textbooks are simple indications, such as open circles, of the points at which a function is undefined. Is there a way to do this in ...
19
votes
1answer
574 views
How to create regular (planar) graphs?
How to programmatically create and plot regular planar graphs with $k = 3, 4$ or $6$ (not hypercubes) and regular nonplanar graphs of $k = 8$ (see figure)? Note that what matters is the average ...
19
votes
2answers
754 views
Generating a broken or snipped axis in ListPlot
I have two data sets, data1 and data2. For example:
...
18
votes
8answers
1k views
Shading between polar graphs
Since PolarPlot doesn't support Filling, what is the best way to shade or fill the a region between two polar curves?
For ...
18
votes
2answers
2k views
Marking points of intersection between two curves
I'm trying to illustrate the solutions numerically and graphically for an equation such as Tan[x] == x. I think I did everything ok except I wanted to mark each ...
18
votes
3answers
1k views
How does one set a logarithmic scale in a ContourPlot?
How does one set a logarithmic scale for both x and y axes in ContourPlot in Mathematica?
18
votes
3answers
2k views
Computing and plotting a spectrogram in Mathematica
How can I compute and plot the spectrogram of a signal/time series/data in Mathematica? I have a WAV file, sampled at 44100 samples/second and I want to generate a spectrogram of that data. Something ...
18
votes
4answers
1k views
How to plot Venn diagrams with Mathematica?
How does one plot Venn diagrams with Mathematica? I've searched quite a bit and I've found one source at MathWorld which provides the source code for doing them.
But I don't understand this code, can ...
18
votes
4answers
935 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 ...
18
votes
5answers
429 views
In a ListPlot of LinearModelFit, Fill to the regression line
In the help for LinearModelFit, the regression line can be added to the scatter plot like this:
Show[ListPlot[data], Plot[lm[x], {x, 0, 5}]]
Is it possible to ...
18
votes
3answers
885 views
Avoiding white lines inside filled area in RegionPlot exported as PDF or PS
When doing a RegionPlotand then exporting (or saving from the front end) as PDF or EPS, there are small white lines in the filling of the region. Here's an example ...
18
votes
2answers
737 views
How to plot planar graphs as such?
A planar graph is a graph that can be drawn in the plane such that no two edges cross.
For example, the graph ...
17
votes
5answers
2k views
Using PlotLegends with Show messes up the graphics
I have already obtained the plot that I want but am having trouble legending the graph correctly.
...


