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
42 votes
3 answers
40k views

How can I plot implicit equations?

If you enter the following into Wolfram | Alpha, you get nice graphs: graph 4 x^4 + y^2 = 2 How do you do this in Mathmatica? I realize that these are not ...
Rollie's user avatar
  • 491
41 votes
2 answers
3k 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 ...
ssch's user avatar
  • 16.6k
41 votes
5 answers
15k views

My Girlfriend is going to prison...Save her with Math

Salacious title, but true story. ...
Prisoners Dilema's user avatar
41 votes
1 answer
7k views

How to generate image like QR code with Mathematica

How to generate such form of QR code which displays an image itself but is still scan-able?
Wjx's user avatar
  • 9,558
40 votes
9 answers
6k 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 ...
Mike Honeychurch's user avatar
40 votes
2 answers
18k 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 ...
fiz's user avatar
  • 740
40 votes
4 answers
13k views

How to get StreamPlot to draw many hundreds of streamlines?

For artistic reasons, I want to draw an extremely dense StreamPlot with something like a thousand streamlines. I tried setting ...
user avatar
40 votes
5 answers
1k views

How to examine the structure of Graphics objects

One difficulty I'm encountering in studying the structure of Graphics objects is that I have not yet found a way to print or display such structures that are ...
kjo's user avatar
  • 11.7k
40 votes
4 answers
16k views

Logarithmic scale in a DensityPlot and its legend

I was recently faced with the task of creating a DensityPlot with a logarithmic colour scale, and with providing it with an appropriate legend. Since I could not find any resources to this effect on ...
Emilio Pisanty's user avatar
40 votes
1 answer
13k views

How to export transparent raster plots?

Is there an easy way to get transparent plots that work with Save Graphic As using a compatible file format such as GIF or PNG? I tried ...
Emre's user avatar
  • 1,710
39 votes
5 answers
22k views

Plotting Error Bars on a Log Scale

I have a plot with ErrorListPlot ...
s0rce's user avatar
  • 9,602
38 votes
7 answers
66k views

How can I plot the direction field for a differential equation?

I'd like to plot the graph of the direction field for a differential equation, to get a feel for it. I'm a novice, right now, when it comes to plotting in Mathematica, so I'm hoping that someone can ...
Matt Groff's user avatar
  • 1,141
38 votes
4 answers
5k views

How to create a wind rose with Mathematica?

I am trying to plot wind rose in Mathematica, but have no idea how to do this. Any suggestions ?
bushiwo's user avatar
  • 487
38 votes
2 answers
2k views

How to generate a picture like this?

How to generate a picture like the following (from Paolo Čerić's blog)? I'd like the surface of the manifold to randomly distort.
user13253's user avatar
  • 8,666
38 votes
4 answers
19k views

Is there an option to change the space/distance between tick labels and axes labels for plots?

In an attempt to squeeze more plots and controls into the limited space for a demo UI, I am trying to remove any extra white spaces I see. I am not sure what options to use to reduce the amount of ...
Nasser's user avatar
  • 142k
37 votes
2 answers
11k views

Trying to visualize the Collatz conjecture

I happen to have this collatz collatz[x_, y_] := If[x == 3*y || x == 2*y + 1 || y == 3*x || y == 2*x + 2, 2, 0] So i want a visual 3D adjacency graph of my ...
Madona wambua's user avatar
37 votes
4 answers
2k views

How to implement the sample-point process like the built-ins of Mathematica?

Consider this: pts = {{0, 0}, {1, 1}, {2, -1}, {3, 0}, {4, -2}, {5, 1}}; f = BSplineFunction[pts] I can use ParametricPlot to ...
xyz's user avatar
  • 605
37 votes
7 answers
19k views

Changing the background color of the framed region of a plot

I frequently generate framed plots like this: Plot[Sin[x], {x, 0, 2 π}, Frame -> True] Is there an easy way to change the background color of the framed ...
Cassini's user avatar
  • 5,556
37 votes
6 answers
35k views

Flipping axis on a plot

I want to make a 2D plot where the x-axis is flipped so the higher numbers are on the right and lower numbers are on the left. I've managed to do it by flipping the data and making new ...
s0rce's user avatar
  • 9,602
37 votes
1 answer
29k views

Plot, extract data to a file

I need to save data that Mathematica uses inside the Plot command. The format that I would like to have is: x1 y1 x2 y2 ..... ...
molkee's user avatar
  • 899
37 votes
2 answers
2k views

Specifying non-conflicting PlotTheme options

A bug or limitation in 10.0.0 affects a few of these examples; it was resolved in 10.1.0. I am trying out Mathematica 10 on https://programming.wolframcloud.com. ...
Yi Wang's user avatar
  • 7,347
36 votes
3 answers
2k 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 ...
Antonio Vargas's user avatar
36 votes
2 answers
21k views

3D heatmap density plot

I have a set of data that looks like {{x1, y1, z1}, {x2, y2, z2}, ...} so it describes points in 3D space. I want to make a heatmap out of this data. So that points ...
norty's user avatar
  • 463
36 votes
1 answer
2k views

Drawing Clifford Attractors in Mathematica

I came upon the "Clifford Attractor" today, which are equations of the form: $$x_{n+1}=\sin(a\ y_n) + c \cos(x_n)$$ $$y_{n+1}=\sin(b\ x_n) + d \cos(y_n)$$ They create some incredible images by ...
Nico A's user avatar
  • 3,624
35 votes
5 answers
31k views

Remove tick labels, but retain tick marks in RegionPlot (and related functions)

I would like to remove the numbering on the axes of the following RegionPlot. I would like to keep the tick marks but drop the numbering, I haven't figured out how ...
tlehman's user avatar
  • 2,144
35 votes
4 answers
17k views

How to insert a plot into another plot

I would like to know whether there is a way to insert a plot into another plot. I would like to do some plot from a function an then, inside this plot, in the right down corner add a smaller plot of ...
pablo's user avatar
  • 723
35 votes
3 answers
9k 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 ...
Andrew Spott's user avatar
  • 1,581
35 votes
4 answers
7k views

Real Size Image Printing

I am generating a complicated graphics with Mathematica, but with objects of given sizes (e.g. a line of length 1 inch, between two points). I want to make sure that when I export the graphics, e.g. ...
Yigal Meir's user avatar
35 votes
3 answers
5k 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 ...
Szabolcs's user avatar
  • 234k
35 votes
3 answers
2k 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 ...
István Zachar's user avatar
34 votes
3 answers
3k views

Visualize an irrational number

I would like to visualize an irrational number like the square root of 2 with Mathematica. I found this visualization of Pi in the internet and wonder how this ...
Arji's user avatar
  • 1,134
34 votes
3 answers
5k views

Plot a piecewise function with black and white disks marking discontinuities

Let's say I'd like to plot Sign[x + 0.5]: Plot[Sign[x + 0.5], {x, -1, 1}] Mathematica will give this: This plot does not ...
user11426's user avatar
  • 464
34 votes
2 answers
6k views

Joining and interpolating data points

I wonder what is the best practice for interpolating curves? Usually, I'm using BSplineCurve and adjusting SplineWeights so it ...
swish's user avatar
  • 7,791
34 votes
3 answers
2k 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 ...
Joseph's user avatar
  • 1,306
34 votes
4 answers
4k views

How to make a 3D topographic globe?

I've made some attempt with this dataset of elevation. But I have some trouble with ListSurfacePlot3D, which can not show the globe correctly: And I've checked ...
RexDiego's user avatar
  • 594
34 votes
2 answers
1k views

Symbolic derivatives are being calculated numerically

Update: (1) By V11, not sure of the exact version, the derivative IntegerPart' has been given a symbolic definition. (2) The numeric derivative computed has changed ...
Dr. belisarius's user avatar
34 votes
1 answer
2k views

What is wrong with triangle PlotMarkers in v.10.0.0?

Bug introduced in 10.0.0 and fixed in 10.0.1 In Mathematica 10.0.0 we have built-in graphical triangle PlotMarkers. Let us look closer on them: ...
Alexey Popkov's user avatar
33 votes
3 answers
8k views

I'd like to display field lines for a point charge in 3 dimensions

I'd like to display field lines for a point charge in 3 dimensions. Not a force field (short arrows) but continuous field lines that start on the charge.
Rainforest Frog's user avatar
33 votes
4 answers
5k views

Plotting large datasets

I have a lot of data (e.g., 64x8192), to plot and it consumes too much memory (more than 2 GB) causing Mathematica to return "no memory available". For example, ...
yulinlinyu's user avatar
  • 4,805
33 votes
2 answers
2k views

How does Plot work?

I considered the following function: sin[x_] := Module[{}, Print["x=", x]; Sin[x] ] in Mathematica. Next, I tried to plot it using: ...
Dror's user avatar
  • 1,831
33 votes
7 answers
4k views

Make legend same height as plot

One common style for density plots is to have a vertical legend that is the same height as the plot itself. Some example density plots from Google Image search: How can we make DensityPlots with ...
Andrew Moylan's user avatar
33 votes
4 answers
3k views

Is it possible to draw really thin lines in Mathematica?

I want to have in Mathematica the same result I have in Python: I have this nice effect simply by using very thin lines. But it seems in Mathematica thickness property has some limit and i just got ...
funnyp0ny's user avatar
  • 1,905
33 votes
4 answers
14k views

Problems specifying number of bins in Histogram

So I wanted to create a Histogram with a custom number of bins. Luckily there is a simple function for this in the form of Histogram[data, n] where n specifies the ...
Mr Alpha's user avatar
  • 3,156
33 votes
1 answer
3k views

Visual representation of a Ranking over time (image provided)

[Disclaimer: I initially posted this question on stackOverflow 2 months ago and think it might be better suited for this forum (link to original question)] The graph below shows a ranking of ...
Seb's user avatar
  • 735
33 votes
1 answer
1k views

Terrifying performance decrease for contour/density plots in v10.1 -> 10.3

Bug introduced in 10.3 and fixed in 10.3.1 I setup for download a test dataset at http://www.inrim.it/~magni/cm.dat.gz (a set of 64800 triplets x,y,z). The behavior can be reproduced with the ...
alessandro's user avatar
  • 1,085
32 votes
10 answers
8k 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 ...
Isaac's user avatar
  • 3,189
32 votes
4 answers
5k views

Show density plot on a geographic map

I have a bunch of data points in the form of {latitude, longitude}. How can I plot their density on a US map? Single points on the map do not clearly show their ...
Qiang Li's user avatar
  • 1,111
32 votes
5 answers
17k views

How to keep markers as dots in a joined ListPlot?

Consider the following typical interactive sequence. First I produce a ListPlot: OK, not bad, but I want those dots to be bigger, and also joined. First, I make ...
kjo's user avatar
  • 11.7k
32 votes
5 answers
14k views

How do I make framed plots the same size?

Suppose that I have two plots, plot1 and plot2. The plots have different ranges and different axes. Here is a fictitious ...
Andrew's user avatar
  • 10.5k
32 votes
1 answer
30k views

Mathematica code for Bifurcation Diagram

At the moment I am trying to construct a bifurcation diagram of the iterative function $f(x)=$ $ax-1.1975x^3$. I've scoured the internet for pre-made bifurcation diagrams and found many (mostly of the ...
Mel's user avatar
  • 475