Questions tagged [plotting]

Questions on creating visualizations from functions or data using high-level constructors such as Plot, ListPlot, Histogram, etc.

Filter by
Sorted by
Tagged with
641 votes
7 answers
193k views

xkcd-style Plots

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 ...
Amatya's user avatar
  • 6,818
355 votes
6 answers
236k 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 ...
Simpleton Jack's user avatar
161 votes
12 answers
55k 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 ...
500's user avatar
  • 5,529
145 votes
3 answers
22k 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 ...
István Zachar's user avatar
108 votes
4 answers
16k views

Plot draws list of curves in same color 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 ...
trayres's user avatar
  • 1,205
104 votes
2 answers
7k views

Is it possible to define a new PlotTheme?

In version 10 one can define, say, $PlotTheme = "Scientific" Which changes the appearance of all plots. This is fantastic because on the one hand I can have nice ...
Yi Wang's user avatar
  • 7,317
96 votes
2 answers
56k views

What are the standard colors for plots in Mathematica 10? [duplicate]

Mathematica 10 release appears to have changed the default styling of plots: the most visible changes are thicker lines and different default colors. Thus, answers to this stackoverflow question are ...
Ruslan's user avatar
  • 7,122
92 votes
5 answers
15k 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. ...
Mr.Wizard's user avatar
  • 270k
83 votes
4 answers
17k views

Placing a ContourPlot under a Plot3D

I would like to combine a 3-dimensional graph of a function with its 2-dimensional contour-plot underneath it in a professional way. But I have no idea how to start. I have a three of these I would ...
QuantumDot's user avatar
  • 19.5k
81 votes
8 answers
144k views

How to add a vertical line to a plot?

In the plot below I would like to add two vertical lines at $x = \frac{\pi}{15} \pm \frac{1}{20}$. How can I do that? ...
sjdh's user avatar
  • 7,617
77 votes
4 answers
15k 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, $$\begin{align*}F(x,y,...
J. M.'s eventual burnout's user avatar
76 votes
4 answers
14k 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 ...
István Zachar's user avatar
75 votes
3 answers
8k views

How can we make publication-quality PlotMarkers without version 10?

Suppose that for certain reasons we are not yet using Mathematica version 10, or we have a version with buggy PlotMarkers. It is well known that the default markers ...
Oleksandr R.'s user avatar
  • 22.9k
72 votes
3 answers
7k views

Python-style plots in Mathematica

I love making plots in Mathematica. And I love to spend a lot of time making high-quality plots that maximize readability and aesthetics. For most cases, Mathematica can make very beautiful images, ...
Dargor's user avatar
  • 1,369
72 votes
3 answers
4k views

Sketch-type graphics with transparency and dashed hidden lines?

I'd like to create transparent graphs like the following from P1095, Calculus 6th Ed, by James Stewart. Can Mathematica accomplish this? By "transparent," I mean the ability to see the interior, ...
user avatar
72 votes
5 answers
12k 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: ...
Thomas's user avatar
  • 1,967
69 votes
5 answers
31k 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 ...
Eiyrioü von Kauyf's user avatar
69 votes
4 answers
6k views

Point Renderings Slightly Off in Mathematica

The Mathematica code ...
Tyson Williams's user avatar
68 votes
8 answers
11k 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 ...
Red Banana's user avatar
  • 5,121
67 votes
2 answers
6k views

How to make this beautiful animation

How to make an animation of following gif in Mathematica? Edit: The animation shown above was created by Charlie Deck in processing. And how to make 3D analog? I tried first few steps ...
vito's user avatar
  • 8,868
65 votes
9 answers
49k 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 experience,...
Tianxiang Xiong's user avatar
60 votes
6 answers
18k views

How do I plot coordinates (latitude and longitude pairs) on a geographic map?

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 ...
Peter House's user avatar
58 votes
2 answers
6k views

Mathematica2tikz an equivalent function

Matlab2tikz is a script which generates native LaTeX/TikZ figures from MATLAB. I am looking for an equivalent method/function in Mathematica. Obviously the final script may need some manual tinkering ...
akk's user avatar
  • 1,247
56 votes
2 answers
8k views

Do I have to code each case of this Grid full of plots separately?

I have written some custom functions to draw multi-panel graphs like this one: It's done by passing a matrix of (custom) plotting functions to a MultiPanelGraph ...
Verbeia's user avatar
  • 34.1k
55 votes
5 answers
10k views

Vary the thickness of a plotted function

I know, that I can change the color of a function with the help of PlotStyle: Plot[Sin[x], {x, 0, 3 Pi}, PlotStyle -> {Green, Thickness[0.01]}] I also know, ...
abrhv's user avatar
  • 653
55 votes
4 answers
11k views

Generating a broken or snipped axis in ListPlot

I have two data sets, data1 and data2. For example: ...
Andrew's user avatar
  • 10.4k
54 votes
8 answers
9k views

How to plot ternary density plots?

How can I get a ternary density plot just like the plots from OriginLab? ContourPlot and DensityPlot seemingly can accept the <...
Scott Wang's user avatar
54 votes
5 answers
16k 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 ...
QuantumDot's user avatar
  • 19.5k
53 votes
4 answers
6k 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 ...
jens_bo's user avatar
  • 1,804
51 votes
2 answers
4k views

High-quality RegionPlot3D for logical combinations of predicates

Unlike RegionPlot, RegionPlot3D copes poorly with logical combinations of predicates (...
user avatar
50 votes
9 answers
13k views

About multi-root search in Mathematica for transcendental equations

I have some questions for multiroot search for transcendental equations. Is there any clever solution to find all the roots for a transcendental equation in a specific range? Perhaps ...
yulinlinyu's user avatar
  • 4,795
49 votes
3 answers
4k views

Why are my plots displaying behind the axes?

I need to create graphs with light gray axes and black lines. All of my plots display behind the axes. How can I make the plots display over the axes? ...
lvames's user avatar
  • 431
48 votes
3 answers
27k views

How to change plot style or other options after it was created

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 ...
matheorem's user avatar
  • 17k
48 votes
3 answers
3k views

Implementing hexagon binning in mathematica

Hexagon bin plots are a useful way of visualising large datasets of bivariate data. Here are a few examples: With bin frequency indicated by grey level... ..and by glyph size There are packages for ...
geordie's user avatar
  • 3,683
47 votes
7 answers
6k 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, to create a "snake-like" path. Here is an image I found to illustrate: I can't seem to figure out if ...
s0rce's user avatar
  • 9,572
47 votes
5 answers
2k views

How can the behavior of InterpolationOrder->0 be controlled?

In ListPlot and Interpolation, the option InterpolationOrder->0 uses two different ...
ArgentoSapiens's user avatar
46 votes
7 answers
7k views

How to plot contours on the faces of a cube

I'm trying to plot contours of a function f[x,y,z] on the faces of a cube as the example below, which represents the domain of this function. Is there a way to do ...
RaphaelDavid's user avatar
46 votes
3 answers
71k views

Plotting a Phase Portrait

I'm trying to plot a phase portrait for the differential equation $$x'' - (1 - x^2) x' + x = 0.5 \cos(1.1 t)\,.$$ The primes are derivatives with respect to $t$. I've reduced this second order ODE to ...
covertbob's user avatar
  • 617
46 votes
4 answers
22k 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?
Noble P. Abraham's user avatar
46 votes
3 answers
25k views

What are the possible ways of visualizing a 4D function in Mathematica?

I have a function $F$ that maps the xyz space to a set of reals, more clearly: $c = F[x,y,z]$ Where $c$,$x$,$y$ and $z$ are reals. What are the possible ways of visualizing this 3d function in ...
JLagana's user avatar
  • 621
46 votes
5 answers
14k 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'...
Cassini's user avatar
  • 5,340
46 votes
4 answers
10k 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 ...
Simon's user avatar
  • 10.1k
46 votes
4 answers
37k views

How can I save both the plot and the legend together?

In this example, how can I put the legend inside the graph? Currently, when I save the graph, only the graph is saved, not the legend. ...
Mika Ike's user avatar
  • 3,181
45 votes
4 answers
7k 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.
Mike Honeychurch's user avatar
45 votes
4 answers
19k views

Is there something like DensityPlot3D to visualize atomic orbitals?

I'm visualizing some hydrogen like atomic orbitals. For looking at plane slices of the probability density, the DensityPlot function works well, and with something ...
Peeter Joot's user avatar
  • 6,388
45 votes
5 answers
5k 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 <...
faleichik's user avatar
  • 12.6k
45 votes
5 answers
5k 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 ...
F'x's user avatar
  • 10.8k
44 votes
3 answers
3k views

How to Make a Sankey Diagram

I have two lists start = {{1},{1},{1},{2},{3},{1}} end = {{1},{2},{2},{3},{3},{1}} And I want to create a Sankey diagram. Which looks something like So, ...
Tomi's user avatar
  • 4,262
44 votes
2 answers
4k 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 ...
Chris Degnen's user avatar
  • 30.8k
42 votes
5 answers
48k views

Plotting Complex Quantity Functions

Trying to plot with complex quantities seems not to work properly in what I want to accomplish. I would like to know if there is a general rule/way of plotting when you have complex counterparts in ...
night owl's user avatar
  • 1,719

1
2 3 4 5
313