Questions tagged [plotting]
Questions on creating visualizations from functions or data using high-level constructors such as Plot, ListPlot, Histogram, etc.
15,613
questions
32
votes
2
answers
3k
views
Plot Option Precedence while combining Plots with Show[]
I like to build sophisticated plots by combining simpler ones with Show[]. Typically this involves setting non-default Plot-Options with the different Plot-Commands,...
32
votes
3
answers
2k
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 (...
31
votes
11
answers
3k
views
Plotting the Star of Bethlehem
Christmas is around the corner! In preparation, consider the polynomial
f[x_,y_]:= 1/10 (4 - x^2 - 2 y^2)^2 + 1/2 (x^2 + y^2)
and define $r=(f_x,f_y)$ using the ...
31
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 ...
31
votes
5
answers
6k
views
Mathematica envelope for the bottom of a plot, a generic function
I have the following set-up:
xaxis = Table[x, {x, 0, 10, 0.01}];
yaxis = Table [Sin[x] + Abs[RandomReal[{-1, 1}]], {x, 0, 10, 0.01}];
ListLinePlot[Transpose[{
xaxis, yaxis}]]
My questions is how can ...
31
votes
5
answers
6k
views
How to plot the contour of f[x,y]==0 if always f[x,y]>=0
I've been stuck at this problem for weeks and I've asked several related questions here:
ContourPlot shows only part of the contours [duplicate]
How to plot the contour of the radius part of a ...
31
votes
2
answers
11k
views
Creating a simulation of our Solar System
As the title says, my objective is to create a simulation of the motion of the planets in our Solar System using Mathematica. All the theoretical background regarding the equations of motion of ...
31
votes
2
answers
6k
views
Export Plot3D in Mathematica 10.1 is Rasterized by default
When I use Export to export Plot3D to PDF format, I get different behaviour in Mathematica 10.1 compared to 10.0. In particular, ...
30
votes
6
answers
8k
views
Plotting several functions
I'd like to plot a function of one real and one integer variable, but I don't want them all shown in the same 2-D plot - I'd like to see them as separate curves so I can see both "axes", more like how ...
30
votes
4
answers
3k
views
Scale Insetted Characters to Plot
I am trying to place a curly brace within a plot such that the top/bottom of the curly brace line up with two horizontal lines in the plot:
I have not been able to find a way to make the curly brace ...
30
votes
5
answers
7k
views
Plotting piecewise function with distinct colors in each section
I have a piecewise function that I would like to plot but I was wondering if it is possible that each part of the function that is plotted when its corresponding condition is true be plotted with a ...
30
votes
2
answers
67k
views
Make a scatter plot from two lists
I have two lists of values
xx = {0.1, 0.3, 0.35, 0.57, 0.88, 1.0}
yy = {1.2, 3.5, 4.5, 7.8, 9.0, 12.2}
I want to make a scatter plot (list plot) with xx as x ...
30
votes
4
answers
7k
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 ...
30
votes
4
answers
13k
views
Making Axes logarithmic in 3d plots
I've been trying to get loglog plots in 3D, but to no avail. My initial approach was to take the logarithm inside the plot i.e
...
30
votes
3
answers
12k
views
Plotting a set of trajectories (not a vector field) in 3D
Consider a set of trajectories in 3D space, that possibly converge. By visualizing trajectories as arrows the result will look crowded as each arrowhead will be placed where the attractor is. In 2D, ...
30
votes
1
answer
2k
views
How to plot data by counties?
I'd like to plot county data as in this D3 example:
Is there a way to do this with GeoGraphics, or at least to get path polygons per county and then plot them with different colors?
The first thing ...
30
votes
3
answers
2k
views
Save as pdf broken in version 10.0.2?
Fixed in 10.1
It looks like the save as pdf is broken after I update to version 10.0.2. The labels in the plot become a mess.
Are there ways to fix it? The Export ...
29
votes
7
answers
5k
views
How do I draw a Circular Graph colored like this in Mathematica?
I must plot some data in radians and would like to use this image as a background to that graph. Although it looks good, the lines are degraded in image form; thus, the reason for this question. Can ...
29
votes
5
answers
7k
views
Make a beautiful Moiré effect
How do I make the following Moiré pattern?
I tried:
...
29
votes
6
answers
22k
views
Filling between boundaries
I would like to visualize what it graphically means to integrate between two boundary values. Therefore I'd like to make a Filling between these two values. Is ...
29
votes
3
answers
16k
views
About the number format in ticks
I want to LogPlot a function, but I have the trouble in the number format in the ticks.
For example,
...
29
votes
6
answers
6k
views
Using ListPointPlot3D to simulate 2D plots moving in time
I wrote a 1D solver for the heat equation $u_t=u_{xx}$, and I can animate the solution using normal ListPlot command, where the x-axis is the rod length, and the y-...
29
votes
2
answers
2k
views
Where can I get detailed information on how the Plot command works?
The command
Plot[x^2, {x, -3, 3}, PlotStyle -> Arrowheads[{-.025, .025}]] /.Line -> Arrow
produces this output.
What I don't understand is what ...
29
votes
4
answers
1k
views
Place a small gap between axes and plot?
See for example this picture produced with R:
You can see there is a small white space between the x-axis and the y-axis, so that the axes do not cross. How can I do this with Mathematica, for a <...
29
votes
3
answers
3k
views
How to change ColorFunction after plotting
Say I have a plot like
plot = DensityPlot[ Exp[-((x-5)^2+(y-5)^2)/5^2],
{x, 0, 10}, {y, 0, 10}, PlotRange -> {0,1} ]
Is there a way to ...
29
votes
2
answers
4k
views
What is the fundamental difference between ArrayPlot and MatrixPlot?
Suppose I have a matrix called data. It seems that I can plot data using either ArrayPlot or ...
29
votes
2
answers
3k
views
Switch from logarithmic to linear scaling partway along a plot's axis
In the 2015 Planck satellite results, they give the latest plot of the temperature power spectrum of the cosmic microwave background, which I show below. (I am only interested in the main plot; you ...
29
votes
1
answer
754
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, ...
29
votes
1
answer
948
views
Why is ListPlot so slow here?
While examining How can I monitor the progress of a Plot? I was surprised to discover that in some cases ListPlot in version 10.0 and 10.1 is orders of magnitude ...
28
votes
5
answers
4k
views
How to plot Error Bars in a 3D scatter plot
This is a simple problem which is proving difficult to solve. I want to plot error bars on points in a 3D scatter graph. I plot error bars on points within a 2D scatter by:
...
28
votes
3
answers
12k
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 (
...
28
votes
3
answers
4k
views
Improve Plot3D resolution near max/mins
I have the following function
$$V(r) = \sum_{i=1}^N 4 \epsilon_i \left(\frac{\sigma_i^{12}}{\|r-r_{0i}\|^{12}}-\frac{\sigma_i^6}{\|r-r_{0i}\|^6}\right)$$
which -for those interested- corresponds to ...
28
votes
5
answers
1k
views
Compiling ColorFunction for faster complex phase-amplitude plots
I have gotten into the habit of plotting complex-valued functions on a plane using a color-function along the lines of
Function[{z}, Hue[Arg[z]/(2 π), 1, Abs[z]]].
...
28
votes
4
answers
8k
views
Data interpolation and ListContourPlot
I am fairly new to Mathematica and I have two quick questions on using it for a Hydrology and Hydrogeology class. One is about data interpolation and interpolating without any data defined in an area. ...
28
votes
2
answers
1k
views
Filling Space with Pursuit Polygons
I want to make a program which can fill a 2D space with "pursuit polygons".
The following picture will help you understand better what I mean.
You can also look up "pursuit curves" or mice problem or ...
27
votes
7
answers
9k
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.
...
27
votes
5
answers
2k
views
Plot a partition of the sphere given vertices of polygons
I saw in this question that Mathematica can draw spherical triangles. I guess something similar can be done to plot a spherical polygon. I am interested in something similar:
I have a set of points ...
27
votes
7
answers
15k
views
Plotting discontinuous functions without spurious vertical segments
Consider the plot of this discontinuous function:
f[x_] := If[2 < x < 3, 0, x]
Plot[f[x], {x, 0, 5}]
I'd like to plot that without the vertical segments.
...
27
votes
4
answers
9k
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 ...
27
votes
3
answers
34k
views
Placing x-axes label below rather than at end of axes
By default Mathematica places the x-axis labels at the end of the axes like
Googling has suggested a way around this is to use Frame- for example ...
27
votes
2
answers
3k
views
Phase portrait on a cylinder
It is very nice and very easy to make a sketch of a phase portrait with StreamPlot. For example, for the classical pendulum, defined by
\begin{eqnarray*}
\dot x&...
27
votes
4
answers
2k
views
Implementing a Beeswarm plot in Mathematica
I am looking for a Beeswarm plot implementation in Mathematica.
Consider the following data:
...
27
votes
2
answers
1k
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 ...
27
votes
1
answer
6k
views
How to draw grid lines on top of a plot?
I want to use ArrayPlot instead of a DensityPlot because it seems to be faster (more here)
I still want axes ticks to have real ...
27
votes
3
answers
7k
views
Visualizing a Complex Vector Field near Poles
I've been playing around with a visualization technique for complex functions where one views the function $f: \mathbb{C} \rightarrow \mathbb{C}$ as the vector field $f: \mathbb{R^2} \rightarrow \...
27
votes
3
answers
1k
views
How can I make Plot show the plot while it's computing it?
Normally, Plot acts like a black box and only gives you the requested plot once it has finished computing it.
However it can be useful, other than interesting, to ...
27
votes
2
answers
40k
views
Placing text within a plot
I want to place text within a plot. The text is always centered relative to the coordinates. How can I left-align or right-align the text relative to the coordinates? For example:
...
26
votes
5
answers
3k
views
Magnifying Glass on a Plot
Although there is a trick in TEX magnifying glass but I want to know is there any function to magnifying glass on a plot with Mathematica?
For example for a function as ...
26
votes
3
answers
3k
views
Plot 3D model of DNA in Mathematica
My friend asked me if we can plot a 3D model of DNA (deoxyribonucleic acid) in Mathematica. However, I am not really familiar with this and I don't know if Mathematica can do this. Could you answer ...
26
votes
4
answers
4k
views
Hightlight all the self-intersections of a Lissajous figure
This graph–also known as a Lissajous figure–contains so many self-intersections.How can I highlight them?
...