Plotting Lists of Data

The Wolfram Language can be used to make plots of functions. You give the Wolfram Language a function, and it builds up a curve or surface by evaluating the function at many different points.

Here we describe how you can make plots from lists of data, instead of functions. ("Importing and Exporting Data" discusses how to read data from external files and programs.) The Wolfram Language commands for plotting lists of data are direct analogs of the ones for plotting functions.

ListPlot[{y1,y2,}]plot at x values
ListPlot[{{x1,y1},{x2,y2},}]plot points
ListLinePlot[list]join the points with lines
ListPlot3D[{{z11,z12,},{z21,z22,},}]
make a threedimensional plot of the array of heights
ListPlot3D[{{x1,y1,z1},{x2,y2,z2},}]
make a three-dimensional plot with heights at positions
ListContourPlot[array]make a contour plot
ListDensityPlot[array]make a density plot

Functions for plotting lists of data.

Here is a list of values.
In[1]:=
Click for copyable input
Out[1]=
This plots the values.
In[2]:=
Click for copyable input
Out[2]=
This joins the points with lines.
In[3]:=
Click for copyable input
Out[3]=
When plotting multiple datasets, the Wolfram Language chooses a different color for each dataset automatically.
In[4]:=
Click for copyable input
Out[4]=
This gives a list of pairs.
In[5]:=
Click for copyable input
Out[5]=
This plots the points.
In[6]:=
Click for copyable input
Out[6]=
This gives a rectangular array of values. The array is quite large, so we end the input with a semicolon to stop the result from being printed out.
In[7]:=
Click for copyable input
This makes a threedimensional plot of the array of values.
In[8]:=
Click for copyable input
Out[8]=
This gives a density plot of the array of values.
In[9]:=
Click for copyable input
Out[9]=